zlib-0.4.0.4: Compression and decompression in the gzip and zlib formats

Portabilityportable (H98 + FFI)
Stabilityprovisional
Maintainerduncan.coutts@worc.ox.ac.uk

Codec.Compression.Zlib.Internal

Contents

Description

Pure stream based interface to lower level zlib wrapper

Synopsis

Compression and decompression

data Format Source

Constructors

GZip

Encode or decode with the gzip header format.

Zlib

Encode or decode with the zlib header format.

Raw

Encode or decode a raw data stream without any header.

GZipOrZlib

Enable zlib or gzip decoding with automatic header detection. This only makes sense for decompression.

data CompressionLevel Source

Control amount of compression. This is a trade-off between the amount of compression and the time and memory required to do the compression.

Constructors

DefaultCompression

The default compression level is 6 (that is, biased towards high compression at expense of speed).

NoCompression

No compression, just a block copy.

BestSpeed

The fastest compression method (less compression)

BestCompression

The slowest compression method (best compression).

CompressionLevel Int

A specific compression level between 1 and 9.

The same but with the full set of parameters

data Method Source

The compression method

Constructors

Deflated

'Deflate' is the only one supported in this version of zlib.

Instances

data MemoryLevel Source

The MemoryLevel parameter specifies how much memory should be allocated for the internal compression state.

Constructors

DefaultMemoryLevel

The default. (Equivalent to MemoryLevel 8)

MinMemoryLevel

Use minimum memory. This is slow and reduces the compression ratio. (Equivalent to MemoryLevel 1)

MaxMemoryLevel

Use maximum memory for optimal compression speed. (Equivalent to MemoryLevel 9)

MemoryLevel Int

Use a specific level in the range 1..9

Instances

data CompressionStrategy Source

The strategy parameter is used to tune the compression algorithm.

The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately.

Constructors

DefaultStrategy

Use the DefaultStrategy for normal data.

Filtered

Use Filtered for data produced by a filter (or predictor). 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 Z_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between DefaultStrategy and HuffmanOnly.

HuffmanOnly

Use HuffmanOnly to force Huffman encoding only (no string match).