Deflate
class Deflate extends Stream (View source)
A deflate stream supporting deflate, zlib and gzip encodings.
Constants
FLUSH_NONE |
Do no intermittent flushes. |
FLUSH_SYNC |
Flush at appropriate transfer points. |
FLUSH_FULL |
Flush at each IO operation. |
TYPE_GZIP |
Gzip encoding. RFC1952 |
TYPE_ZLIB |
Zlib encoding. RFC1950 |
TYPE_RAW |
Deflate encoding. RFC1951 |
LEVEL_DEF |
Default compression level. |
LEVEL_MIN |
Least compression level. |
LEVEL_MAX |
Greatest compression level. |
STRATEGY_DEF |
Default compression strategy. |
STRATEGY_FILT |
Filtered compression strategy. |
STRATEGY_HUFF |
Huffman strategy only. |
STRATEGY_RLE |
Run-length encoding strategy. |
STRATEGY_FIXED |
Encoding with fixed Huffman codes only.
|
Methods
Encode data with deflate/zlib/gzip encoding.
Details
__construct(int $flags = 0)
Base constructor for encoding stream implementations.
bool
done()
Check whether the encoding stream is already done.
string
finish()
Finish and reset the encoding stream.
Returns any pending data.
string
flush()
Flush the encoding stream.
Returns any pending data.
string
update(string $data)
Update the encoding stream with more input.
string
encode(string $data, int $flags = 0)
Encode data with deflate/zlib/gzip encoding.