The Bzip2 component implements a bzip2 compressor and decompressor. It is compliant with bzip2 specification.
The bzip2 file format is typically used only to archive a single file. Accordingly, the operation of the component is simpler than that of the other components.
To compress with the component, set ArchiveFile to the name of the bzip2 file to be created, and FileDecompressedName to the name of the file to be compressed. Finally, invoke Compress. To extract the file, set ArchiveFile to the bzip2 archive and FileDecompressedName to the file where the component should extract. Finally, invoke the Extract or Compress method.
Example (Creating a Bzip2 File)
ZipControl.ArchiveFile = "c:\test.bz2" ZipControl.FileDecompressedName = "c:\test.txt" ZipControl.Compress()Example (Extracting from a Bzip2 File)
ZipControl.ArchiveFile = "c:\test.bz2" ZipControl.FileDecompressedName = "c:\test.txt" ZipControl.Extract()
The following is the full list of the properties of the component with short descriptions. Click on the links for further details.
|ArchiveFile||The name of the zip, gzip, tar, or jar archive.|
|Bzip2Data||(Decompression only) The bzip2 file contents as a byte array.|
|ExtractToPath||A base path to decompress to.|
|FileDecompressedName||File name to decompress to, or compress from.|
|FileInputData||The data of the file to be compressed.|
|HasMoreData||Shows whether or not there is more data in the bzip2 archive.|
The following is the full list of the methods of the component with short descriptions. Click on the links for further details.
|Abort||Aborts the current operation.|
|Append||Adds specified file to an existing archive.|
|Compress||Creates the compressed bzip2 archive.|
|Config||Sets or retrieves a configuration setting.|
|Extract||Extracts the compressed file from the bzip2 archive.|
|ExtractAll||Extracts all files from the compressed archive.|
|Reset||Resets the component.|
|Scan||Scans the compressed archive.|
|SetArchiveInputStream||The stream to read the zip, tar, jar, or gzip archive from.|
|SetArchiveOutputStream||The stream to write the zip, tar, jar, or gzip archive to.|
|SetFileInputStream||The input stream to read the decompressed data from.|
The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.
|BeginFile||Fired before a file is processed.|
|EndFile||Fired after a file is processed.|
|Error||Information about non-fatal errors.|
|Overwrite||Fired whenever a file exists and may be overwritten.|
|Progress||Fired as progress is made.|
The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.
|CloseStreamAfterCompress||If true, the component will close the output stream after compression.|
|WriteToProgressEvent||Whether or not to write data to the Progress Event.|
|BuildInfo||Information about the product's build.|
|GUIAvailable||Tells the component whether or not a message loop is available for processing events.|
|LicenseInfo||Information about the current license.|
|UseInternalSecurityAPI||Tells the component whether or not to use the system security libraries or an internal implementation.|