streaming-brotli-0.0.0.0: Streaming interface for Brotli (RFC7932) compression

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

Streaming.Brotli

Contents

Description

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

Synopsis

Simple interface

compress Source #

Arguments

:: MonadIO m 
=> ByteString m r

compressed stream

-> ByteString m r

uncompressed stream

Compress into a Brotli compressed stream.

decompress Source #

Arguments

:: MonadIO m 
=> ByteString m r

compressed stream

-> ByteString m (ByteString m r)

uncompressed stream

Decompress a compressed Brotli stream.

The monadic return value is a stream representing the possibly unconsumed leftover data from the input stream; see also decompress_.

decompress_ Source #

Arguments

:: MonadIO m 
=> ByteString m r

compressed stream

-> ByteString m r

uncompressed stream

Convenience wrapper around decompress which fails eagerly if the compressed stream contains any trailing data

Extended interface

Compression

compressWith Source #

Arguments

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

uncompressed stream

-> ByteString m r

compressed stream

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 Source #

Arguments

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

compressed stream

-> ByteString m (ByteString m r)

uncompressed stream

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)