Hallo,
Ich verstehe gerade nicht das Problem. Folgendes:
Delphi-Quellcode:
procedure Beispiel(AStream: TMemoryStream);
var tmp: TMemoryStream;
begin
tmp := TMemoryStream.Create;
try
tmp.SetSize(CalcEncodedSize(AStream.Size));
Base64Encode(AStream.Memory^,AStream.Size,tmp.Memory^);
AStream.Clear; // <--
AStream.Write(tmp.Memory^,tmp.Size);
finally
tmp.Free;
end;
end;
An der markierten Stelle kracht es. Außerdem stehen in tmp nach Base64Encode nur 0-Bytes.
Was mache ich denn falsch?
Gruß
Neutral General
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."