Registriert seit: 6. Apr 2005
10.109 Beiträge
|
Re: FileStream mit ZLib De-/Komprimieren
4. Jul 2005, 21:47
Delphi-Quellcode:
program fcompress;
{$APPTYPE CONSOLE}
uses
Classes,
SysUtils,
ZLib;
var
fsIn, fsOut: TFileStream;
procedure CompressStream(inStream, outStream: TStream);
var
cs: TCompressionStream;
begin
cs := TCompressionStream.Create(clDefault, outStream);
cs.CopyFrom(inStream, inStream.Size);
cs.OnProgress := nil; // das geht auch anders
cs.Free;
end;
begin
fsIn := TFileStream.Create(ParamStr(1), fmOpenRead);
fsOut := TFileStream.Create(ParamStr(2), fmCreate);
CompressStream(fsIn, fsOut);
fsOut.Free;
fsIn.Free;
end.
Grüße vom marabu
|
|
Zitat
|