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 };
Inheritance

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 from T 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<int>, R> other) Codec<Object, 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