Delphi Database, Delphi Components from ComponentAce
Products Download Order Contact us
/img/help/home.gif /img/help/prev.gif /img/help/next.gif


Creating compressed file stream



Easy Compression Library provides a file stream interface with TECLFileStream class that has two standard parameters (FileName, Mode) in constructor and two extended parameters (Password and CompressionLevel).

When the Password parameter is not blank, it is used to encrypt the file (except the case when CompressionLevel is eclNone).

CompressionLevel indicates the algorithm and mode that is used for file compression.

When CompressionLevel is eclNone (by default), TECLFileStream is equal to TFileStream, i.e. it could be used to read from/write to usual non-compressed file.

The following example illustrates how to create encrypted file with fastest compression using TECLFileStream.



CompFS: TECLFileStream;


{ create encrypted and compressed file stream }

CompFS := TECLFileStream.Create('c:\test_comp.ecl', fmCreate, 'Password', zlibFastest);

{ load, compress and encrypt test.txt }


{ close destination file }




        © 2003 - 2024 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Jul 18, 2024