brotli-conduit-0.0.0.0: Conduit interface for Brotli (RFC7932) compression.

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

Data.Conduit.Brotli

Contents

Description

Compression and decompression of data streams in the "Brotli" format (RFC7932)

Synopsis

Simple interface

compress :: MonadIO m => ConduitM ByteString ByteString m () Source #

Compress a ByteString into a Brotli container stream.

decompress :: (MonadThrow m, MonadIO m) => ConduitM ByteString ByteString m () Source #

Decompress a ByteString from a compressed Brotli stream.

Extended interface

Compression

compressWith :: MonadIO m => CompressParams -> ConduitM ByteString ByteString m () 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 :: (MonadThrow m, MonadIO m) => DecompressParams -> ConduitM ByteString ByteString m () 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)