Copyright | (c) Dong Han 2017-2018 |
---|---|
License | BSD |
Maintainer | winterland1989@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module provides zlib bindings.
Synopsis
- data CompressConfig = CompressConfig {}
- defaultCompressConfig :: CompressConfig
- compress :: HasCallStack => CompressConfig -> Bytes -> Bytes
- compressSink :: HasCallStack => CompressConfig -> Sink Bytes -> IO (Sink Bytes)
- data Strategy
- pattern Z_FILTERED :: Strategy
- pattern Z_HUFFMAN_ONLY :: Strategy
- pattern Z_RLE :: Strategy
- pattern Z_FIXED :: Strategy
- pattern Z_DEFAULT_STRATEGY :: Strategy
- data CompressLevel
- pattern Z_BEST_SPEED :: CompressLevel
- pattern Z_BEST_COMPRESSION :: CompressLevel
- pattern Z_DEFAULT_COMPRESSION :: CompressLevel
- data WindowBits
- defaultWindowBits :: WindowBits
- data MemLevel
- defaultMemLevel :: MemLevel
- data DecompressConfig = DecompressConfig {
- decompressWindowBits :: WindowBits
- decompressDictionary :: CBytes
- defaultDecompressConfig :: DecompressConfig
- decompress :: HasCallStack => DecompressConfig -> Bytes -> Bytes
- decompressSource :: DecompressConfig -> Source Bytes -> IO (Source Bytes)
Compression
data CompressConfig Source #
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.
pattern Z_FILTERED :: Strategy Source #
pattern Z_HUFFMAN_ONLY :: Strategy Source #
pattern Z_DEFAULT_STRATEGY :: Strategy Source #
data CompressLevel Source #
Instances
Eq CompressLevel Source # | |
Defined in Z.Compression.Zlib (==) :: CompressLevel -> CompressLevel -> Bool # (/=) :: CompressLevel -> CompressLevel -> Bool # | |
Ord CompressLevel Source # | |
Defined in Z.Compression.Zlib compare :: CompressLevel -> CompressLevel -> Ordering # (<) :: CompressLevel -> CompressLevel -> Bool # (<=) :: CompressLevel -> CompressLevel -> Bool # (>) :: CompressLevel -> CompressLevel -> Bool # (>=) :: CompressLevel -> CompressLevel -> Bool # max :: CompressLevel -> CompressLevel -> CompressLevel # min :: CompressLevel -> CompressLevel -> CompressLevel # | |
Show CompressLevel Source # | |
Defined in Z.Compression.Zlib showsPrec :: Int -> CompressLevel -> ShowS # show :: CompressLevel -> String # showList :: [CompressLevel] -> ShowS # |
pattern Z_BEST_SPEED :: CompressLevel Source #
pattern Z_BEST_COMPRESSION :: CompressLevel Source #
pattern Z_DEFAULT_COMPRESSION :: CompressLevel Source #
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.
Instances
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
data DecompressConfig Source #
decompress :: HasCallStack => DecompressConfig -> Bytes -> Bytes Source #
Decompress some bytes.
decompressSource :: DecompressConfig -> Source Bytes -> IO (Source Bytes) Source #
Decompress bytes from source.