可以用流,压缩、加密都比较方便。
var
tmpSrcStream, tmpDesStream: TStream;
begin
tmpSrcStream:= TFileStream.Create('c:/123.dat', fmOpenRead);
tmpDesStream:= TFileStream.Create('c:/456.dat', fmCreate);
try
tmpDesStream.CopyFrom(tmpSrcStream);
{ 再对tmpDesStream做加密运算 }
finally
tmpSrcStream.Free;
tmpDesStream.Free;
end;
end;