IPWorks ZIP 2020 ActiveX Edition

Questions / Feedback?

ZipStream Control

Properties   Methods   Events   Configuration Settings   Errors  

The ZipStream control is used to perform compression or decompression.

Syntax

ZipStream

Remarks

The ZipStream control provides a way to compress and decompress streamed data.

Data may be operated on in multiple ways as discussed below. The StreamFormat property specifies the algorithm to us. Possible values are:

  • Deflate
  • Zlib
  • Gzip

CompressBlock and DecompressBlock

The CompressBlock and DecompressBlock methods operate on blocks (chunks) of data. The methods may be used to compress and decompress data as it becomes available.

Note that when using blocks of data the OutputData property is not applicable. Instead data is made available through the CompressedData and DecompressedData events.

If all data is available ahead of time CompressData and DecompressData may be called instead.

Compress Data

Set InputData to the current block to be compressed. Next call CompressBlock to compress the current block. Note that CompressBlock takes a LastBlock parameter. If the block of data is the final block to be compressed set this to True. For all other blocks set this to False.

During compression the CompressedData event will fire with the compressed data. Note that this event may not fire for every call to CompressBlock due to the way the compression algorithm operates. For example:


zipstream.InputDataB = MyDecompressedData;
zipstream.CompressBlock();
Data is accumulated inside the CompressedData event:
private static void Zipstream_OnCompressedData(object sender, ZipstreamCompressedDataEventArgs e)
{
  DoSomethingWith(e.DataB);
}

Note that OutputData is not applicable when compressing block data.

Decompress Data

Set InputData to the current block to be decompressed. Next call DecompressBlock to decompress the current block.

During decompression the DecompressedData event will fire with the decompressed data. Note that this event may not fire for every call to DecompressBlock due to the way the decompression algorithm operates. For example:


zipstream.InputDataB = MyCompressedData;
zipstream.DecompressBlock();
Data is accumulated inside the DecompressedData event:
private static void Zipstream_OnDecompressedData(object sender, ZipstreamDecompressedDataEventArgs e)
{
  DoSomethingWith(e.DataB);
}

Note that OutputData is not applicable when decompressing block data.

CompressData and DecompressData

The CompressData and DecompressData methods operate on the complete blob of data. The entire compressed or decompressed data must be set to InputData before calling either method.

To compress and decompress data in blocks (chunks) see CompressBlock and DecompressBlock.

Compress Data

Set InputData to the decompressed data. This should be the entire data to be compressed. Next call CompressData. After compression OutputData will hold the compressed data. For example:


zipstream.InputDataB = MyDecompressedData;
zipstream.CompressData();
MyCompressedData = zipstream.OutputDataB;

In addition to OutputData, the compressed data may also be accumulated within the CompressedData event.

Decompress Data

Set InputData to the compressed data. This should be the entire data to be decompressed. Next call DecompressData. After decompression OutputData will hold the decompressed data. For example:


zipstream.InputDataB = MyCompressedData;
zipstream.DecompressData();
MyDecompressedData = zipstream.OutputDataB;

In addition to OutputData, the compressed data may also be accumulated within the DecompressedData event.

Property List


The following is the full list of the properties of the control with short descriptions. Click on the links for further details.

CompressionLevelThe compression level to use.
InputDataSpecifies the data to compress or decompress.
OutputDataThe output data after compression or decompression.
StreamFormatThe stream format to use.

Method List


The following is the full list of the methods of the control with short descriptions. Click on the links for further details.

CompressBlockCompresses a block of data.
CompressDataCompresses the specified data.
ConfigSets or retrieves a configuration setting.
DecompressBlockDecompresses a block of data.
DecompressDataDecompresses the specified data.
ResetResets the control.

Event List


The following is the full list of the events fired by the control with short descriptions. Click on the links for further details.

CompressedDataThis event fires with compressed data.
DecompressedDataThis event fires with decompressed data.
ErrorInformation about errors during data delivery.

Configuration Settings


The following is a list of configuration settings for the control with short descriptions. Click on the links for further details.

CodePageThe system code page used for Unicode to Multibyte translations.
UseInternalSecurityAPITells the control whether or not to use the system security libraries or an internal implementation.

 
 
Copyright (c) 2021 /n software inc. - All rights reserved.
IPWorks ZIP 2020 ActiveX Edition - Version 20.0 [Build 7720]