So geht es:
Delphi-Quellcode:
GetMem(SrcBuffer, 1024);
GetMem(DestBuffer, 1024);
try
while (SrcStream.Position < SrcStream.Size) and (Terminated = False) do
begin
if SrcStream.Size - SrcStream.Position > 1024 then
Len := 1024
else
Len := SrcStream.Size - SrcStream.Position;
SrcStream.ReadBuffer(SrcBuffer^, Len);
EncodeBuffer(SrcBuffer^, DestBuffer^, len);
DestStream.WriteBuffer(DestBuffer^, Len);
end;
finally
FreeMem(SrcBuffer);
FreeMem(DestBuffer);
SrcBuffer, DestBuffer sind Pointer und Len ist vom Typ Integer.