pipes-zlib-0.4.0.1: Zlib compression and decompression for Pipes streams

Safe Haskell | None
Language | Haskell98

Pipes.Zlib

Contents

- Streams
- Compression level
- Window size

Description

This module exports utilities to compress and decompress `pipes` streams using the zlib compression codec.

Synopsis

- decompress :: MonadIO m => WindowBits -> Producer' ByteString m r -> Producer' ByteString m r
- compress :: MonadIO m => CompressionLevel -> WindowBits -> Producer' ByteString m r -> Producer' ByteString m r
- defaultCompression :: CompressionLevel
- noCompression :: CompressionLevel
- bestSpeed :: CompressionLevel
- bestCompression :: CompressionLevel
- compressionLevel :: Int -> CompressionLevel
- defaultWindowBits :: WindowBits
- windowBits :: Int -> WindowBits

# Streams

decompress Source

Arguments

:: MonadIO m |
=> WindowBits |
-> Producer' ByteString m r | Compressed stream
-> Producer' ByteString m r | Decompressed stream

Decompress bytes flowing from a `Producer`.

See the Codec.Compression.Zlib module for details about `WindowBits`.

compress Source

Arguments

:: MonadIO m |
=> CompressionLevel |
-> WindowBits |
-> Producer' ByteString m r | Decompressed stream
-> Producer' ByteString m r | Compressed stream

Compress bytes flowing from a `Producer`.

See the Codec.Compression.Zlib module for details about `CompressionLevel` and `WindowBits`.

# Compression level

The following are re-exported from Codec.Compression.Zlib for your convenience.

defaultCompression :: CompressionLevel

The default compression level is 6 (that is, biased towards higher compression at expense of speed).

noCompression :: CompressionLevel

No compression, just a block copy.

bestSpeed :: CompressionLevel

The fastest compression method (less compression)

bestCompression :: CompressionLevel

The slowest compression method (best compression).

compressionLevel :: Int -> CompressionLevel

A specific compression level between 0 and 9.

# Window size

The following are re-exported from Codec.Compression.Zlib for your convenience.

defaultWindowBits :: WindowBits

The default `WindowBits` is 15 which is also the maximum size.

windowBits :: Int -> WindowBits

A specific compression window size, specified in bits in the range `8..15`