http\Encoding
[mdref/mdref] / http / Encoding / Stream / Deflate.md
1 # class http\Encoding\Stream\Deflate extends http\Encoding\Stream
2
3 A deflate stream supporting deflate, zlib and gzip encodings.
4
5 ## Constants:
6
7 * TYPE_GZIP
8 Gzip encoding. RFC1952
9 * TYPE_ZLIB
10 Zlib encoding. RFC1950
11 * TYPE_RAW
12 Deflate encoding. RFC1951
13 * LEVEL_DEF
14 Default compression level.
15 * LEVEL_MIN
16 Least compression level.
17 * LEVEL_MAX
18 Greatest compression level.
19 * STRATEGY_DEF
20 Default compression strategy.
21 * STRATEGY_FILT
22 Filtered compression strategy.
23 * STRATEGY_HUFF
24 Huffman strategy only.
25 * STRATEGY_RLE
26 Run-length encoding strategy.
27 * STRATEGY_FIXED
28 Encoding with fixed Huffman codes only.
29
30 > **A note on the compression strategy:**
31 >
32 > The strategy parameter is used to tune the compression algorithm.
33 >
34 > Use the value DEFAULT_STRATEGY for normal data, FILTERED for data produced by a filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no string match), or RLE to limit match distances to one (run-length encoding).
35 >
36 > Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between DEFAULT_STRATEGY and HUFFMAN_ONLY.
37 >
38 > RLE is designed to be almost as fast as HUFFMAN_ONLY, but give better compression for PNG image data.
39 >
40 > FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications.
41 >
42 > The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately.
43 >
44 >_Source: [zlib Manual](http://www.zlib.net/manual.html)_
45
46
47 ## Properties:
48
49 None.