Codec<S, T> class
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.
- Implementers
Constructors
- Codec() const
Properties
- decoder → Converter<
T, S> read-only - Returns the decoder of
this, converting fromTtoS. [...] - encoder → Converter<
S, T> read-only - Returns the encoder from
StoT. [...] - hashCode → int read-only, inherited
- The hash code for this object. [...]
- inverted → Codec<
T, S> read-only - Inverts
this. [...] - runtimeType → Type read-only, inherited
- A representation of the runtime type of the object.
Methods
- decode(
T encoded) → S - Decodes
encodeddata. [...] - encode(
S input) → T - Encodes
input. [...] - fuse<
R> (Codec< T, R> other) → Codec<S, R> - Fuses
thiswithother. [...] - noSuchMethod(
Invocation invocation) → dynamic inherited - Invoked when a non-existent method or property is accessed. [...]
- toString(
) → String inherited - A string representation of this object. [...]
Operators
- operator ==(
Object other) → bool inherited - The equality operator. [...]
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-convert/Codec-class.html