A Codec encodes and (if supported) decodes data.

Codecs can be fused. For example fusing JSON and UTF8 produces an encoder that can convert Json objects directly to bytes, or can decode bytes directly to json objects.

Fused codecs generally attempt to optimize the operations and can be faster than executing each step of an encoding separately.

Codecs are still experimental and are subject to change without notice.

Implemented by

Constructors

Codec()

const

Properties

decoder Converter<T, S>

Returns the decoder of this, converting from T to S.

read-only
encoder Converter<S, T>

Returns the encoder from S to T.

read-only
hashCode int

Get a hash code for this object.

read-only, inherited
inverted Codec<T, S>

Inverts this.

read-only
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

decode(T encoded) → S

encode(S input) → T

fuse(Codec<T, dynamic> other) Codec<S, dynamic>

Fuses this with other.

noSuchMethod(Invocation invocation) → dynamic

noSuchMethod is invoked when users invoke a non-existent method on an object. The name of the method and the arguments of the invocation are passed to noSuchMethod in an Invocation. If noSuchMethod returns a value, that value becomes the result of the original invocation.

inherited
toString() String

Returns a string representation of this object.

inherited