一、TMemoryStream数据写入到字符串里
var
lvStream:TMemoryStream;
s:AnsiString;
p: PAnsiChar;
begin
lvStream:= TMemoryStream( pvObject);
GetMem(p, lvStream.Size + );
FillChar(p^, lvStream.Size, );
Move(lvStream.Memory^,p^,lvStream.Size);
s:=p;
FreeMem(p);
二、字符串写入到TMemoryStream
var
lvStream:TMemoryStream;
s:AnsiString;
begin
s:='abcdefghjkimoop';
lvStream.Write(s[], Length(s)); lvStream.Position := ;
end;