anchor.diff:  uses
     Classes,
     SysUtils,
  +  Math,
     Sockets,
     Generics.Collections,
     Thrift.Collections,
  
positive.code: begin
    if IsOpen then
    begin
      len := FBuffer.Size;
      if len > 0 then
      begin
        SetLength( buf, len );
        FBuffer.Position := 0;
        FBuffer.Read( Pointer(@buf[0])^, len );
        FStream.Write( buf, 0, len );
      end;
      FBuffer.Clear;
    end;
  end;
  
  function TBufferedStreamImpl.IsOpen: Boolean;
  begin
    Result := (FBuffer <> nil) and ( FStream <> nil);
  end;
  
  procedure TBufferedStreamImpl.Open;
  
negative.code:   private
      FStream : IThriftStream;
      FBufSize : Integer;
      FReadBuffer : TMemoryStream;
      FWriteBuffer : TMemoryStream;
    protected
      procedure Write( const buffer: TBytes; offset: Integer; count: Integer); override;
      function Read( var buffer: TBytes; offset: Integer; count: Integer): Integer; override;
  