Discuss this help topic in SecureBlackbox Forum

Save the archive to the stream

To save the archive to the stream you may use either synchronous or asynchronous compression.

In the first case, once the archive has been populated, simply call TElZIPWriter.Compress() method.

For asynchronous compression, the following steps should be performed:

  1. call TElZIPWriter.BeginCompression() method,
  2. use TElZIPWriter.Add() method one or more times to add entries,
  3. after adding each entry, call TElZIPWriter.UpdateCompression() method,
  4. finally, call TElZIPWriter.EndCompression() method.

Example:
TElZipWriter ZipWriter = new TElZipWriter();
MemoryStream MyArchive = new MemoryStream();
ZipWriter.BeginCompression(MyArchive);
ZipWriter.Add("C:\\temp.txt");
ZipWriter.UpdateCompression();
ZipWriter.Add("C:\\temp.pdf");
ZipWriter.UpdateCompression();
ZipWriter.EndCompression();

How To articles about Zip file operations

Discuss this help topic in SecureBlackbox Forum