Noch mal danke....
die zeiger position wars.....
für die die es interessiert :
Delphi-Quellcode:
function tTestStream.ReadStream: TMemoryStream;
var hSize : Int64;
begin
Result := TMemoryStream.Create;
Read(hSize,Sizeof(hSize));
Result.CopyFrom(Self,hSize);
end;
...
aStream := hStream.ReadStream;
...
procedure TForm1.DateiSave(aStream: TMemoryStream);
var hStream : TStream;
begin
hStream := TFileStream.Create('Test2.exe',fmCreate);
try
aStream.Position := 0;
hStream.CopyFrom(aStream,aStream.Size);
finally
hStream.Free;
end;
end;