Safe Haskell | Safe-Infered |
---|
- data ZState
- deflateInit2 :: CInt -> ZMethod -> CInt -> CInt -> ZStrategy -> IO ZState
- inflateInit2 :: CInt -> IO ZState
- inumZState :: MonadIO m => ZState -> Inum ByteString ByteString m a
- inumZlib :: MonadIO m => Inum ByteString ByteString m a
- inumGzip :: MonadIO m => Inum ByteString ByteString m a
- inumGunzip :: MonadIO m => Inum ByteString ByteString m a
- max_wbits :: CInt
- max_mem_level :: CInt
- def_mem_level :: CInt
- zlib_version :: CString
- z_DEFAULT_COMPRESSION :: CInt
- data ZStrategy
- z_FILTERED :: ZStrategy
- z_HUFFMAN_ONLY :: ZStrategy
- z_RLE :: ZStrategy
- z_FIXED :: ZStrategy
- z_DEFAULT_STRATEGY :: ZStrategy
- data ZMethod
- z_DEFLATED :: ZMethod
Codec and Inum functions
State used by inumZState
, the most generic zlib Inum
.
Create the state using deflateInit2
or inflateInit2
.
:: CInt | Compression level (use |
-> ZMethod | Method (use |
-> CInt |
|
-> CInt |
|
-> ZStrategy | strategy (e.g., |
-> IO ZState |
Create a ZState
for compression. See the description of
deflateInit2
in the zlib.h C header file for a more detailed
description of the arguments. Note in particular that the value of
windowBits
determines the encapsulation format of the compressed
data:
- 8..15 = zlib format
- 24..31 = gzip format
- -8..-15 = means raw zlib format with no header
Create a Zstate
for uncompression. See the description of
inflateInit2
in the zlib.h C header file for a more detailed
description of the arguments. Note in particular that the value of
windowBits
determines the encapsulation format of the compressed
data:
- 8..15 = zlib format
- 24..31 = gzip format
- 40..47 = automatically determine zlib/gzip format
- -8..-15 = means raw zlib format with no header
inumZState :: MonadIO m => ZState -> Inum ByteString ByteString m aSource
The most general zlib Inum
, which can take any ZState
created
by deflateInit2
or inflateInit2
.
inumZlib :: MonadIO m => Inum ByteString ByteString m aSource
An Inum
that compresses in zlib format. To uncompress, use
inumGunzip
.
inumGzip :: MonadIO m => Inum ByteString ByteString m aSource
An Inum
that compresses in gzip format.
inumGunzip :: MonadIO m => Inum ByteString ByteString m aSource
An Inum
that uncompresses a data in either the zlib or gzip
format. Note that this only uncompresses one gzip stream. Thus,
if you feed in the concatenation of multiple gzipped files,
inumGunzip
will stop after the first one. If this is not what
you want, then use
to decode repeated
gzip streams.
inumRepeat
inumGunzip
Constants from zlib.h
Use this value for zlib format. Add 16 for gzip format. Negate for raw zlib format. When uncompressing, add 32 to determine zlib/gzip format automatically.