io-streams-1.3.0.0: Simple, composable, and easy-to-use stream I/O

Safe HaskellNone
LanguageHaskell2010

System.IO.Streams.Zlib

Contents

Description

Interface to zlib and gzip compression for Bytestrings and Builders

Synopsis

ByteString decompression

gunzip :: InputStream ByteString -> IO (InputStream ByteString) Source

Decompress an InputStream of strict ByteStrings from the gzip format

decompress :: InputStream ByteString -> IO (InputStream ByteString) Source

Decompress an InputStream of strict ByteStrings from the zlib format

ByteString compression

gzip :: CompressionLevel -> OutputStream ByteString -> IO (OutputStream ByteString) Source

Convert an OutputStream that consumes compressed ByteStrings into an OutputStream that consumes uncompressed ByteStrings in the gzip format

compress :: CompressionLevel -> OutputStream ByteString -> IO (OutputStream ByteString) Source

Convert an OutputStream that consumes compressed ByteStrings into an OutputStream that consumes uncompressed ByteStrings in the zlib format

Builder compression

gzipBuilder :: CompressionLevel -> OutputStream Builder -> IO (OutputStream Builder) Source

Convert an OutputStream that consumes compressed Builders into an OutputStream that consumes uncompressed Builders in the gzip format

compressBuilder :: CompressionLevel -> OutputStream Builder -> IO (OutputStream Builder) Source

Convert an OutputStream that consumes compressed Builders into an OutputStream that consumes uncompressed Builders in the zlib format

Compression level

newtype CompressionLevel Source

Parameter that defines the tradeoff between speed and compression ratio

Constructors

CompressionLevel Int 

defaultCompressionLevel :: CompressionLevel Source

A compression level that balances speed with compression ratio