-
-
Notifications
You must be signed in to change notification settings - Fork 1
BZip2.Decompressor.Decompress
BZip2.Decompressor.Decompress
Function Decompress(ReadFrom As Readable, WriteTo As Writeable, ReadCount As Integer = -1) As Boolean
Name | Type | Comment |
---|---|---|
ReadFrom | Readable |
The stream from which to read compressed data. |
WriteTo | Writeable |
The stream to which decompressed data will be written. |
ReadCount | Integer |
Optional. If specified, the number of compressed bytes to read. |
This method processes compressed bytes from ReadFrom
into the decompressor, and writes any uncompressed bytes that were emitted to WriteTo
. If ReadCount
is specified then exactly ReadCount
compressed bytes are read; otherwise compressed bytes will continue to be read until ReadFrom.EOF=True
.
This method does not necessarily emit uncompressed bytes immediately. The "sliding window" used by the compressor determines how far ahead the decompressor has to read in order to Decompress one or more bytes at the current stream position. The unprocessed portion of the input is retained by the decompressor until a subsequent call to this method.
If the decompressor needed more compressed bytes than were provided then zero bytes will be emitted and Avail_In
will be >0
. Call Decompress
again with more compressed bytes until Avail_In=0
. If there are no more compressed bytes then the compressed stream is corrupt.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2018-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.