Z-IO-0.1.2.0: Simple and high performance IO toolkit for Haskell
Copyright(c) Dong Han 2017-2018
LicenseBSD
Maintainerwinterland1989@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Z.Compression.Zlib

Description

This module provides zlib bindings.

Synopsis

Compression

compress :: HasCallStack => CompressConfig -> Bytes -> Bytes Source #

Compress some bytes.

compressSink :: HasCallStack => CompressConfig -> Sink Bytes -> IO (Sink Bytes) Source #

Compress all the data written to a output.

data Strategy where Source #

Bundled Patterns

pattern Z_FILTERED :: Strategy 
pattern Z_HUFFMAN_ONLY :: Strategy 
pattern Z_RLE :: Strategy 
pattern Z_FIXED :: Strategy 
pattern Z_DEFAULT_STRATEGY :: Strategy 

Instances

Instances details
Eq Strategy Source # 
Instance details

Defined in Z.Compression.Zlib

Ord Strategy Source # 
Instance details

Defined in Z.Compression.Zlib

Show Strategy Source # 
Instance details

Defined in Z.Compression.Zlib

data WindowBits Source #

The WindowBits is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The defaultWindowBits value is 15. Decompressing windowBits must be greater than or equal to the compressing windowBits. If a compressed stream with a larger window size is given as input, decompress will throw ZDataError windowBits can also be –8..–15 for raw inflate. In this case, -windowBits determines the window size. inflate() will then process raw deflate data, not looking for a zlib or gzip header, not generating a check value, and not looking for any check values for comparison at the end of the stream. windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format.

data MemLevel Source #

The MemLevel specifies how much memory should be allocated for the internal compression state. 1 uses minimum memory but is slow and reduces compression ratio; 9 uses maximum memory for optimal speed. The default value is 8.

Decompression

decompress :: HasCallStack => DecompressConfig -> Bytes -> Bytes Source #

Decompress some bytes.

decompressSource :: DecompressConfig -> Source Bytes -> IO (Source Bytes) Source #

Decompress bytes from source.