BrotliCodec class final

Brotli Codec with configurable encoder/decoder options.

const codec = BrotliCodec();
final compressed = codec.encode(utf8.encode('hello'));
final text = codec.decodeToString(compressed);
Inheritance

Constructors

BrotliCodec({BrotliEncodeOptions encodeOptions = const BrotliEncodeOptions(), BrotliDecodeOptions decodeOptions = const BrotliDecodeOptions()})
const

Properties

decodeOptions → BrotliDecodeOptions
Options used by decode/decoder.
final
decoder → Converter<List<int>, List<int>>
Returns the decoder of this, converting from T to S.
no setteroverride
encodeOptions → BrotliEncodeOptions
Options used by encode/encoder.
final
encoder → Converter<List<int>, List<int>>
Returns the encoder from S to T.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
inverted → Codec<List<int>, List<int>>
Inverts this.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode(List<int> encoded) → List<int>
Decodes encoded data.
override
decodeBytes(Uint8List input) → Uint8List
Decodes input and returns the backing bytes directly.
decodeToString(List<int> input, {bool allowMalformed = false}) → String
Decodes a Brotli-compressed UTF-8 string.
encode(List<int> input) → List<int>
Encodes input.
override
encodeBytes(Uint8List input) → Uint8List
Encodes input and returns the backing bytes directly.
encodeString(String input) → Uint8List
UTF-8-encodes input and compresses it.
fuse<R>(Codec<List<int>, R> other) → Codec<List<int>, R>
Fuses this with other.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited