zlib.Decompressor
The zlib stream decompressor object.
Constructor
deflate.Decompressor(dictionary: string?): zlib.DecompressorMethods
flush | Decodes all input, checks the checksum and returns the decompressed data. |
flush | Decodes all input and returns the decompressed data. |
reset | Drops all input and output, the next update starts a new stream with the same dictionary. |
reset | Drops all input and output, the next update starts a new stream with the same dictionary. |
update | Adds the compressed string to the stream. |
update | Adds the compressed string to the stream. |
#Decompressor:flush
function zlib.Decompressor:flush(): string, string
Decodes all input, checks the checksum and returns the decompressed data.
The stream is reset after this, so the decompressor can be used for the next stream.
Throws an error on malformed or truncated data, or if the checksum does not match; call via pcall() when processing untrusted input.
| Type | Name | Description |
|---|---|---|
string | decompressed_data | The decompressed string. |
string | remaining_data | The data after the end of the stream. |
#Decompressor:flush
function deflate.Decompressor:flush(): string, string
Decodes all input and returns the decompressed data.
The stream is reset after this, so the decompressor can be used for the next stream.
Throws an error on malformed or truncated data; call via pcall() when processing untrusted input.
| Type | Name | Description |
|---|---|---|
string | decompressed_data | The decompressed string. |
string | remaining_data | The data after the end of the stream (like the zlib or gzip trailer). |
#Decompressor:reset
function zlib.Decompressor:reset(): zlib.Decompressor
Drops all input and output, the next update starts a new stream with the same dictionary.
| Type | Name | Description |
|---|---|---|
zlib.Decompressor | self |
#Decompressor:reset
function deflate.Decompressor:reset(): deflate.Decompressor
Drops all input and output, the next update starts a new stream with the same dictionary.
| Type | Name | Description |
|---|---|---|
deflate.Decompressor | self |
#Decompressor:update
function zlib.Decompressor:update(compressed_data: string): zlib.Decompressor
Adds the compressed string to the stream.
Throws an error on malformed data and resets the decompressor; call via pcall() when processing untrusted input.
| Name | Type | Description |
|---|---|---|
compressed_data | string | The next part of the zlib stream. |
| Type | Name | Description |
|---|---|---|
zlib.Decompressor | self |
#Decompressor:update
function deflate.Decompressor:update(compressed_data: string): deflate.Decompressor
Adds the compressed string to the stream.
Input is decoded in parts of at least 32768 bytes, the decompressor is reset on malformed data.
Throws an error on malformed data; call via pcall() when processing untrusted input.
| Name | Type | Description |
|---|---|---|
compressed_data | string | The next part of the DEFLATE stream. |
| Type | Name | Description |
|---|---|---|
deflate.Decompressor | self |