compat library

Compat API: Uint8List/List<int> entry points.

This layer does not expose blit types, so callers can migrate from package:brotli-style APIs without importing package:blit.

Classes

BrotliCodec
Brotli Codec with configurable encoder/decoder options.
BrotliDecodeOptions
Decoder options.
BrotliDecoder
Push-style streaming Brotli decoder.
BrotliDecoderConverter
One-shot decoder converter (Converter<List<int>, List<int>>).
BrotliDecoderSink
Chunked decoder sink: feeds each chunk to a BrotliDecoder and emits every available decompressed chunk immediately.
BrotliDecoderV2
Fast Brotli decoder (v2).
BrotliEncodeOptions
Encoder options.
BrotliEncoder
Push-style streaming Brotli encoder.
BrotliEncoderConverter
One-shot encoder converter (Converter<List<int>, List<int>>).
BrotliEncoderSink
Chunked encoder sink: accumulates input and emits the compressed stream on close (Brotli encoding needs the whole block to make decisions).
BrotliEncoderV2
The v0.2.0 encoder API.
BrotliPreparedDictionary
A compound dictionary with its four-byte-prefix index built once.
BrotliStreamDecoderV2
Streaming v2 decoder over raw Uint8List chunks (no blit types).
BytesInputQueue
FIFO of byte chunks handed to the decoder as a BitReaderInput.

Enums

BrotliErrorCode
Stable, format-oriented error codes.
BrotliMode
Brotli encoder mode.
BrotliStatus
Streaming decoder status.

Constants

v2Lgwin → const int
Window bits used by the v2 fast path.
v2MaxFastQuality → const int
Highest quality served by the v2 fast path. Qualities 2..5 use it; quality 0 and 1 are routed to the v1 greedy encoder, which is measurably faster there, and quality 6+ keeps the v1 quality tiers.
v2MinFastQuality → const int
Lowest quality served by the v2 fast path.

Functions

brotliCompress(Uint8List input, {BrotliEncodeOptions options = const BrotliEncodeOptions()}) → Uint8List
Compresses one complete buffer into a valid Brotli stream.
brotliCompressString(String input, {BrotliEncodeOptions options = const BrotliEncodeOptions()}) → Uint8List
UTF-8-encodes input and compresses it.
brotliDecompress(Uint8List input, {BrotliDecodeOptions options = const BrotliDecodeOptions()}) → Uint8List
Decompresses one complete Brotli stream.
brotliDecompressToString(List<int> input, {BrotliDecodeOptions options = const BrotliDecodeOptions(), bool allowMalformed = false}) → String
Decodes Brotli-compressed input as UTF-8.
maxCompressedSize(int inputSize) → int
Upper bound on the size of brotliCompress output for inputSize bytes.

Exceptions / Errors

BrotliException
Exception thrown for malformed streams, unsupported features and limits.