iteratee-compress-0.3.2.0: Enumeratees for compressing and decompressing streams

Safe HaskellSafe-Infered

Data.Iteratee.BZip

Contents

Synopsis

Enumeratees

enumCompressSource

Arguments

:: MonadIO m 
=> CompressParams

Parameters of compression

-> Enumeratee ByteString ByteString m a 

Compress the input and send to inner iteratee.

enumDecompress :: MonadIO m => DecompressParams -> Enumeratee ByteString ByteString m aSource

Decompress the input and send to inner iteratee. If there is end of zlib stream it is left unprocessed.

Exceptions

data BZipParamsException Source

Denotes error is user-supplied parameter

Constructors

IncorrectBlockSize !Int

Incorrect block size was chosen

IncorrectWorkFactor !Int

Incorrect work size was chosen

IncorrectBufferSize !Int

Incorrect buffer size was chosen

data BZipException Source

Denotes error in compression and decompression

Constructors

ConfigError

bzip2 library internal error

MemError

Memory allocation failed

DataError

Corrupted input

DataErrorMagic

Incorrect magic number

Unexpected !Int

Unknown or unexpected error

IncorrectState

Incorrect state - denotes error in library

Parameters

data CompressParams Source

Set of parameters for compression. For sane defaults use defaultCompressParams

Constructors

CompressParams 

Fields

compressBlockSize :: BlockSize
 
compressWorkFactor :: WorkFactor
 
compressBufferSize :: !Int

The size of output buffer. That is the size of Chunks that will be emitted to inner iterator (except the last Chunk).

data DecompressParams Source

Set of parameters for decompression. For sane defaults see defaultDecompressParams.

Constructors

DecompressParams 

Fields

decompressSaveMemory :: !Bool
 
decompressBufferSize :: !Int

The size of output buffer. That is the size of Chunks that will be emitted to inner iterator (except the last Chunk).

data BlockSize Source

The compression level specify the tradeoff between speed and compression.

Constructors

DefaultBlockSize

Default compression level set at 6

BestSpeed

The fastest compression method (however less compression)

BestCompression

The best compression method (however slowest)

CompressionLevel !Int

Compression level set by number from 1 to 9

data WorkFactor Source

Constructors

DefaultWorkFactor

Default work factor (set at 30)

WorkFactor !Int

Hand-tuned work factor