anchor.diff:  begin
     Flush;
     FStream := nil;
  -  FBuffer.Free;
  -  FBuffer := nil;
  +
  +  FReadBuffer.Free;
  +  FReadBuffer := nil;
  +
  +  FWriteBuffer.Free;
  +  FWriteBuffer := nil;
   end;
   
   constructor TBufferedStreamImpl.Create( const AStream: IThriftStream; ABufSize: Integer);
   begin
     FStream := AStream;
     FBufSize := ABufSize;
  -  FBuffer := TMemoryStream.Create;
  +  FReadBuffer := TMemoryStream.Create;
  +  FWriteBuffer := TMemoryStream.Create;
   end;
   
   destructor TBufferedStreamImpl.Destroy;
  
positive.code: 
    if IsOpen then
    begin
      len := FBuffer.Size;
    end;
  
    SetLength( Result, len);
  
    if len > 0 then
    begin
      FBuffer.Position := 0;
      FBuffer.Read( Pointer(@Result[0])^, len );
    end;
  end;
  
  
negative.code: uses
    Classes,
    SysUtils,
    Math,
    Sockets,
    Generics.Collections,
    Thrift.Collections,
  