The Uncompress method decompresses data entirely in memory. The Uncompress method deals with data that was compressed by the Compress method, and does not deal with zip files or zipped data. It works the same was as the Compress method does, and supports the same streaming data and encryption capabilities.
Method Uncompress(vaSource As Variant, vaUncompressed As Variant, bEndOfData) As xcdCompressionError
|Declaration (DLL API)|
|vaSource||The data to uncompress. The variant can contain a string or a byte array.|
|vaUncompressed||The uncompressed data is placed here, in the form of a byte array variant. The content of the vaUncompressed parameter is always cleared before writing the uncompressed data to it.|
|bEndOfData||Set this parameter to True if you only have a single block of data to uncompress and require that the uncompressed data be immediately written to the vaUncompressed parameter. Set this parameter to False if you are dealing with streaming data.|
The bEndOfData parameter allows you to provide the decompression engine with data to uncompress as it becomes available. Whenever you have some new data to uncompress, put your data in the vaSource parameter, set bEndOfData to False, then call the Uncompress method. When the call completes, the decompression engine may or may not have written any uncompressed data to the vaUncompressed parameter. If there is data in the vaUncompressed parameter, you must grab it before calling the Uncompress method again, because if there is new uncompressed data, it will overwrite data currently in the vaUncompressed parameter. When your last block of data is sent to the Uncompress method in this fashion, set bEndOfData to True. The decompression engine will flush all remaining uncompressed data to the vaUncompressed parameter's variable.
See the xcdCompressionError topic for a description of the possible return values. If this function is failing, make sure you are passing it exactly the same data you received from the Compress method.
If the data was encrypted when it was compressed, you will have to provide the decryption password by setting the EncryptionPassword property. If you do not do this, you will get the xceInvalidPassword return value.
The compressed data contains a 32-bit checksum that is used by the Uncompress method to make sure that the data uncompresses properly and is identical to the original uncompressed data sent to the Compress method. If the data is uncompressed and has a bad checksum, you will get the xceChecksumFailed return value.
The Xceed Compression control's EncryptionPassword property.