brotli-streams-0.0.0.0: IO-Streams interface for Brotli (RFC7932) compression

Copyright© 2016 Herbert Valerio Riedel
LicenseBSD3
Maintainerhvr@gnu.org
Safe HaskellTrustworthy
LanguageHaskell2010

System.IO.Streams.Brotli

Contents

Description

Simple IO-Streams interface for Brotli compression (RFC7932).

Synopsis

Simple interface

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

Convert an OutputStream that consumes compressed ByteStrings (in the Brotli format) into an OutputStream that consumes uncompressed ByteStrings

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

Decompress a Brotli-compressed InputStream of strict ByteStrings

Extended interface

Compression

compressWith :: CompressParams -> OutputStream ByteString -> IO (OutputStream ByteString) Source #

Like compress but with the ability to specify various compression parameters. Typical usage:

compressWith defaultCompressParams { compress... = ... }

defaultCompressParams :: CompressParams #

The default set of parameters for compression. This is typically used with the compressWith function with specific parameters overridden.

data CompressParams #

Set of parameters for compression. The defaults are defaultCompressParams.

compressSizeHint :: CompressParams -> Word32 #

CompressParams field: Estimated total input size. The default value is 0, which means that the total input size is unknown.

data CompressionLevel #

Compression quality setting

Instances
Bounded CompressionLevel 
Instance details

Defined in LibBrotli

Enum CompressionLevel 
Instance details

Defined in LibBrotli

Eq CompressionLevel 
Instance details

Defined in LibBrotli

Ord CompressionLevel 
Instance details

Defined in LibBrotli

Read CompressionLevel 
Instance details

Defined in LibBrotli

Show CompressionLevel 
Instance details

Defined in LibBrotli

data CompressionWindowSize #

Recommended sliding LZ77 window size.

The encoder may reduce this value (if e.g. input is much smaller than window size).

Instances
Bounded CompressionWindowSize 
Instance details

Defined in LibBrotli

Enum CompressionWindowSize

This Enum instance is offset by 10.

>>> toEnum CompressionWindowBits10
10
>>> fromEnum 22 :: CompressionWindowSize
CompressionWindowBits22
Instance details

Defined in LibBrotli

Eq CompressionWindowSize 
Instance details

Defined in LibBrotli

Ord CompressionWindowSize 
Instance details

Defined in LibBrotli

Read CompressionWindowSize 
Instance details

Defined in LibBrotli

Show CompressionWindowSize 
Instance details

Defined in LibBrotli

data CompressionMode #

Encoding profile

Constructors

CompressionModeGeneric

Format-agnostic default mode

CompressionModeText

UTF-8 formatted text data

CompressionModeFont

Compression mode used in WOFF 2.0

Decompression

decompressWith :: DecompressParams -> InputStream ByteString -> IO (InputStream ByteString) Source #

Like decompress but with the ability to specify various decompression parameters. Typical usage:

decompressWith defaultDecompressParams { decompress... = ... }

defaultDecompressParams :: DecompressParams #

The default set of parameters for decompression. This is typically used with the decompressWith function with specific parameters overridden.

data DecompressParams #

Set of parameters for decompression. The defaults are defaultDecompressParams.

decompressDisableRingBufferReallocation :: DecompressParams -> Bool #

DecompressParams field: If True, ring buffer is allocated according to window size, despite the real size of the content. (default: False)