streaming-utils-0.2.1.0: http, attoparsec, pipes and other utilities for the streaming libraries
Safe HaskellNone
LanguageHaskell2010

Streaming.Zip

Description

This module modifies material in Renzo Carbonara's pipes-zlib package.

Synopsis

Streams

decompress Source #

Arguments

:: MonadIO m 
=> WindowBits 
-> ByteString m r

Compressed stream

-> ByteString m r

Decompressed stream

Decompress a streaming bytestring. WindowBits is from Codec.Compression.Zlib

decompress defaultWindowBits :: MonadIO m => ByteString m r -> ByteString m r

decompress' Source #

Arguments

:: MonadIO m 
=> WindowBits 
-> ByteString m r

Compressed byte stream

-> ByteString m (Either (ByteString m r) r)

Decompressed byte stream, ending with either leftovers or a result

Decompress a zipped byte stream, returning any leftover input that follows the compressed material.

decompressAll :: MonadIO m => WindowBits -> ByteString m r -> ByteString m r Source #

Keep decompressing a compressed bytestream until exhausted.

compress Source #

Arguments

:: MonadIO m 
=> CompressionLevel 
-> WindowBits 
-> ByteString m r

Decompressed stream

-> ByteString m r

Compressed stream

Compress a byte stream.

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

gunzip Source #

Arguments

:: MonadIO m 
=> ByteString m r

Compressed stream

-> ByteString m r

Decompressed stream

Decompress a gzipped byte stream.

gunzip' Source #

Arguments

:: MonadIO m 
=> ByteString m r

Compressed byte stream

-> ByteString m (Either (ByteString m r) r)

Decompressed bytes stream, returning either a ByteString of the leftover input or the return value from the input ByteString.

Decompress a gzipped byte stream, returning any leftover input that follows the compressed stream.

gzip Source #

Arguments

:: MonadIO m 
=> CompressionLevel 
-> ByteString m r

Decompressed stream

-> ByteString m r

Compressed stream

Compress a byte stream in the gzip format.

Compression levels

compressionLevel :: Int -> CompressionLevel Source #

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.