gzip.Compressor
The gzip stream compressor object.
Constructor
deflate.Compressor(options: gzip.Options?): gzip.CompressorMethods
flush | Compresses all input and returns the gzip stream. |
flush | Compresses all input, writes the last block and returns the compressed data. |
reset | Drops all input and output, the next update starts a new stream with the same options. |
reset | Drops all input and output, the next update starts a new stream with the same options. |
update | Adds the string to the stream. |
update | Adds the string to the stream. |
#Compressor:flush
function gzip.Compressor:flush(): string
Compresses all input and returns the gzip stream.
The stream is reset after this, so the compressor can be used for the next stream.
| Type | Name | Description |
|---|---|---|
string | compressed_data |
#Compressor:flush
function deflate.Compressor:flush(): string
Compresses all input, writes the last block and returns the compressed data.
The stream is reset after this, so the compressor can be used for the next stream.
| Type | Name | Description |
|---|---|---|
string | compressed_data |
#Compressor:reset
function gzip.Compressor:reset(): gzip.Compressor
Drops all input and output, the next update starts a new stream with the same options.
| Type | Name | Description |
|---|---|---|
gzip.Compressor | self |
#Compressor:reset
function deflate.Compressor:reset(): deflate.Compressor
Drops all input and output, the next update starts a new stream with the same options.
| Type | Name | Description |
|---|---|---|
deflate.Compressor | self |
#Compressor:update
function gzip.Compressor:update(raw_data: string): gzip.Compressor
Adds the string to the stream.
Input is compressed in parts of at least 32768 bytes, the output is the same as gzip.compress of all input.
| Name | Type | Description |
|---|---|---|
raw_data | string | The string to add. |
| Type | Name | Description |
|---|---|---|
gzip.Compressor | self |
#Compressor:update
function deflate.Compressor:update(raw_data: string): deflate.Compressor
Adds the string to the stream.
Input is compressed in parts of at least 32768 bytes, the last 258 bytes always wait for more input, since a match can continue into it.
The output is the same as deflate.compress of all input, unless another stream or deflate.compress is used between the updates, then the unfinished block is written early, which costs a few bytes.
| Name | Type | Description |
|---|---|---|
raw_data | string | The string to add. |
| Type | Name | Description |
|---|---|---|
deflate.Compressor | self |