JsonToBytesCodec class
JSON to Bytes Codec
A codec that converts between JSON objects
and byte data
.
const codec = JsonToBytesCodec();
final jsonData = { 'a': 0 };
final byteData = codec.encode(jsonData);
print(codec.decode(byteData)); // { 'a': 0 };
Constructors
- JsonToBytesCodec.new()
-
Creates a codec to convert between JSON objects and byte data.
const
Properties
-
decoder
→ Converter<
List< int> , Object> -
Returns the decoder of
this
, converting fromT
to S.no setteroverride -
encoder
→ Converter<
Object, 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> , Object> -
Inverts
this
.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
decode(
List< int> encoded) → Object -
Decodes
encoded
data.inherited -
encode(
Object input) → List< int> -
Encodes
input
.inherited -
fuse<
R> (Codec< List< other) → Codec<int> , R>Object, R> -
Fuses
this
withother
.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