anchor.diff:  
     if IsOpen then
     begin
  -    len := FBuffer.Size;
  +    len := FReadBuffer.Size;
     end;
   
     SetLength( Result, len);
   
     if len > 0 then
     begin
  -    FBuffer.Position := 0;
  -    FBuffer.Read( Pointer(@Result[0])^, len );
  +    FReadBuffer.Position := 0;
  +    FReadBuffer.Read( Pointer(@Result[0])^, len );
     end;
   end;
   
  
positive.code: uses
    Classes,
    SysUtils,
    Sockets,
    Generics.Collections,
    Thrift.Collections,
  
negative.code: begin
    inherited;
    Result := 0;
    if IsOpen then
    begin
      while count > 0 do begin
  
        if FReadBuffer.Position >= FReadBuffer.Size then
        begin
          FReadBuffer.Clear;
          SetLength( tempbuf, FBufSize);
          nRead := FStream.Read( tempbuf, 0, FBufSize );
          if nRead = 0 then Break; // avoid infinite loop
  
          FReadBuffer.WriteBuffer( Pointer(@tempbuf[0])^, nRead );
          FReadBuffer.Position := 0;
        end;
  
        if FReadBuffer.Position < FReadBuffer.Size then
        begin
          nRead  := Min( FReadBuffer.Size - FReadBuffer.Position, count);
          Inc( Result, FReadBuffer.Read( Pointer(@buffer[offset])^, nRead));
          Dec( count, nRead);
          Inc( offset, nRead);
        end;
      end;
    end;
  