Implement buffered transport


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666386 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/alterl/src/thrift_transport.erl b/lib/alterl/src/thrift_transport.erl
index bf9dc53..c47d90f 100644
--- a/lib/alterl/src/thrift_transport.erl
+++ b/lib/alterl/src/thrift_transport.erl
@@ -4,12 +4,14 @@
 
          new/2,
          write/2,
-         read/2
+         read/2,
+         flush/1
         ]).
 
 behaviour_info(callbacks) ->
     [{write/2,
-      read/2}];
+      read/2,
+      flush/1}];
 behaviour_info(_Else) -> undefined.
 
 
@@ -27,3 +29,6 @@
 read(Transport, Len) when is_integer(Len) ->
     Module = Transport#transport.module,
     Module:read(Transport#transport.data, Len).
+
+flush(#transport{module = Module, data = Data}) ->
+    Module:flush(Data).