Portability | portable (H98 + FFI) |
---|---|
Stability | provisional |
Maintainer | duncan.coutts@worc.ox.ac.uk |
Pure stream based interface to lower level zlib wrapper
- compressDefault :: Format -> CompressionLevel -> ByteString -> ByteString
- decompressDefault :: Format -> ByteString -> ByteString
- data Format
- = GZip
- | Zlib
- | Raw
- | GZipOrZlib
- data CompressionLevel
- compressFull :: Format -> CompressionLevel -> Method -> WindowBits -> MemoryLevel -> CompressionStrategy -> ByteString -> ByteString
- decompressFull :: Format -> WindowBits -> ByteString -> ByteString
- data Method = Deflated
- data WindowBits
- data MemoryLevel
- data CompressionStrategy
Compression and decompression
compressDefault :: Format -> CompressionLevel -> ByteString -> ByteStringSource
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.
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
compressFull :: Format -> CompressionLevel -> Method -> WindowBits -> MemoryLevel -> CompressionStrategy -> ByteString -> ByteStringSource
decompressFull :: Format -> WindowBits -> ByteString -> ByteStringSource
The compression method
Deflated | 'Deflate' is the only one supported in this version of zlib. |
data MemoryLevel Source
The MemoryLevel
parameter specifies how much memory should be allocated
for the internal compression state.
DefaultMemoryLevel | The default. (Equivalent to |
MinMemoryLevel | Use minimum memory. This is slow and reduces the
compression ratio. (Equivalent to |
MaxMemoryLevel | Use maximum memory for optimal compression speed.
(Equivalent to |
MemoryLevel Int | Use a specific level in the range 1..9 |
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.
DefaultStrategy | Use the |
Filtered | Use |
HuffmanOnly | Use |