StandardMessageCodec class

MessageCodec using the Flutter standard binary encoding.

Supported messages are acyclic values of these forms:

Decoded values will use List<dynamic> and Map<dynamic, dynamic> irrespective of content.

On Android, messages are represented as follows:

On iOS, messages are represented as follows:

When sending a java.math.BigInteger from Java, it is converted into a String with the hexadecimal representation of the integer. (The value is tagged as being a big integer; subclasses of this class could be made to support it natively; see the discussion at writeValue.) This codec does not support sending big integers from Dart.

The codec is extensible by subclasses overriding writeValue and readValueOfType.

Implemented types


Creates a MessageCodec using the Flutter standard binary encoding.


hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


decodeMessage(ByteData message) → dynamic
Decodes the specified message from binary. [...]
encodeMessage(dynamic message) ByteData
Encodes the specified message in binary. [...]
readSize(ReadBuffer buffer) int
Reads a non-negative int from buffer as written by writeSize. [...]
readValue(ReadBuffer buffer) → dynamic
Reads a value from buffer as written by writeValue. [...]
readValueOfType(int type, ReadBuffer buffer) → dynamic
Reads a value of the indicated type from buffer. [...]
writeSize(WriteBuffer buffer, int value) → void
Writes a non-negative 32-bit integer value to buffer using an expanding 1-5 byte encoding that optimizes for small values. [...]
writeValue(WriteBuffer buffer, dynamic value) → void
Writes value to buffer by first writing a type discriminator byte, then the value itself. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toString() String
Returns a string representation of this object.


operator ==(dynamic other) bool
The equality operator. [...]