anchor.diff:      Inc(NewLineIndex);
     end;
   
  -  Result := FBufferedData.ToString;
  +  Result := FBufferedData.ToString.Substring(FBufferOffset);
     SetLength(Result, NewLineIndex);
  -  FBufferedData.Remove(0, PostNewLineIndex);
  +  inc(FBufferOffset, PostNewLineIndex);
   end;
   
   function TAdvStreamReader.ReadToEnd: string;
  
positive.code:     FStream: TAdvStream;
      FCursor : Integer;
      FEncoding: TEncoding;
      function DetectBOM(var Encoding: TEncoding; Buffer: TBytes): Integer;
      function SkipPreamble(Encoding: TEncoding; Buffer: TBytes): Integer;
      procedure FillBuffer(var Encoding: TEncoding);
  
negative.code:   Result := -1;
    if (FBufferedData <> nil) and (not EndOfStream) then
    begin
      if FBufferedData.Length < 1 + FBufferOffset  then
        FillBuffer(FEncoding);
      Result := Integer(FBufferedData.Chars[FBufferOffset]);
    end;
  end;
  
  function TAdvStreamReader.Read(const Buffer: TCharArray; Index, Count: Integer): Integer;
  begin
    Result := -1;
    if (FBufferedData <> nil) and (not EndOfStream) then
    begin
      while (FBufferedData.Length < Count + FBufferOffset) and (not EndOfStream) and (not FNoDataInStream) do
        FillBuffer(FEncoding);
  
      if FBufferedData.Length > Count + FBufferOffset then
        Result := Count
      else
        Result := FBufferedData.Length - FBufferOffset;
  
      FBufferedData.CopyTo(FBufferOffset, Buffer, Index, Result);
      inc(FBufferOffset, result);
    end;
  end;
  
  function TAdvStreamReader.ReadBlock(const Buffer: TCharArray; Index, Count: Integer): Integer;
  begin
    Result := Read(Buffer, Index, Count);
  end;
  