Hi,
da habe ich was für dich:
Delphi-Quellcode:
function ReadStringFromStream(F: TStream): String;
var
aStrLen : Integer;
begin
F.ReadBuffer(aStrLen,SizeOf(Integer));
SetLength(Result,aStrLen);
if aStrLen > 0 then
F.ReadBuffer(Pointer(Result)^,aStrLen);
end;
procedure WriteStringToStream(F: TStream; aStr: String);
var
aStrLen : Integer;
begin
aStrLen:=Length(aStr);
F.WriteBuffer(aStrLen,SizeOf(Integer));
if aStrLen > 0 then
F.WriteBuffer(Pointer(aStr)^,aStrLen);
end;
Ich hoffe, dass es dir hilft ^^
mfG
mirage228