Graeme Geldenhuys schreef:
2009/10/23 Gerard N/A <gerardusmerca...@gmail.com>:
Could it be that the length indicator bytes of the string are written
to the stream?

Ah, looking at the .WriteAnsiString() implementation, you seem to be
100% correct.

  Procedure TStream.WriteAnsiString (const S : String);
  Var L : Longint;
  begin
    L:=Length(S);
    WriteBuffer (L,SizeOf(L));
    WriteBuffer (Pointer(S)^,L);
  end;


That function is then very deceiving - by doing something extra to
what the method name suggests. Why is the writing of the string length
as a prefix needed?

Otherwise you cannot read it back. :-)

Vincent
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to