iterIO-0.2.2: Iteratee-based IO with pipe operators

Safe HaskellSafe-Infered

Data.IterIO.Zlib

Contents

Synopsis

Codec and Inum functions

data ZState Source

State used by inumZState, the most generic zlib Inum. Create the state using deflateInit2 or inflateInit2.

deflateInit2Source

Arguments

:: CInt

Compression level (use z_DEFAULT_COMPRESSION for default)

-> ZMethod

Method (use z_DEFLATED)

-> CInt

windowBits (e.g., max_wbits)

-> CInt

memLevel (e.g., def_mem_level)

-> ZStrategy

strategy (e.g., z_DEFAULT_STRATEGY)

-> 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

inflateInit2Source

Arguments

:: CInt

windowBits

-> IO ZState 

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 inumRepeat inumGunzip to decode repeated gzip streams.

Constants from zlib.h

max_wbits :: CIntSource

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.