anchor.diff:  
   function StreamToJSONValue(const AStream: TStream; const AEncoding: TEncoding): TJSONValue;
   var
  -  LStreamReader: TStreamReader;
     LEncoding: TEncoding;
  +  LJSONString: string;
   begin
     LEncoding := AEncoding;
     if not Assigned(LEncoding) then
       LEncoding := TEncoding.Default;
   
  -  AStream.Position := 0;
  -  LStreamReader := TStreamReader.Create(AStream, LEncoding);
  -  try
  -    Result := TJSONObject.ParseJSONValue(LStreamReader.ReadToEnd);
  -  finally
  -    LStreamReader.Free;
  -  end;
  +  LJSONString := LEncoding.GetString(StreamToBytes(AStream));
  +  Result := TJSONObject.ParseJSONValue(LJSONString);
   end;
   
   procedure JSONValueToStream(const AValue: TJSONValue; const ADestStream: TStream; const AEncoding: TEncoding);
  
positive.code: 
  function StreamToString(const AStream: TStream; const AEncoding: TEncoding = nil): string;
  var
    LStreamReader: TStreamReader;
    LEncoding: TEncoding;
  begin
    Result := '';
  
negative.code:     LEncoding := TEncoding.Default;
  
    AStream.Position := 0;
    SetLength(LBytes, AStream.Size);
    AStream.Read(LBytes, AStream.Size);
    Result := LEncoding.GetString(LBytes);
  end;
  
  procedure StringToStream(const AStream: TStream; const AString: string; const AEncoding: TEncoding = nil);
  var
    LEncoding: TEncoding;
    LBytes: TBytes;
  begin
    if not Assigned(AStream) then
      Exit;
  
    LEncoding := AEncoding;
    if not Assigned(LEncoding) then
      LEncoding := TEncoding.Default;
  
    LBytes := LEncoding.GetBytes(AString);
  
    AStream.Size := 0;
    AStream.Write(LBytes, Length(LBytes));
  end;
  
  function IsMask(const AString: string): Boolean;
  