MqttEncoding class

Encoding implementation that can encode and decode strings in the MQTT string format.

The MQTT string format is simply a pascal string with ANSI character encoding. The first 2 bytes define the length of the string, and they are followed by the string itself.

Inheritance

Constructors

MqttEncoding()

Properties

decoder Utf8Decoder
Returns the decoder of this, converting from List<int> to String.
no setterinherited
encoder Utf8Encoder
Returns the encoder from String to List<int>.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
inverted Codec<List<int>, String>
Inverts this.
no setterinherited
name String
The name of this codec is "utf-8".
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode(List<int> codeUnits, {bool? allowMalformed}) String
Decodes the UTF-8 codeUnits (a list of unsigned 8-bit integers) to the corresponding string.
inherited
decodeStream(Stream<List<int>> byteStream) Future<String>
inherited
encode(String string) Uint8List
Encodes the string as UTF-8.
inherited
fuse<R>(Codec<List<int>, R> other) Codec<String, R>
Fuses this with other.
inherited
getByteCount(String chars) int
Calculates the number of bytes produced by encoding the characters in the specified.
getBytes(String s) → Uint8Buffer
Encodes all the characters in the specified string into a sequence of bytes.
getCharCount(Uint8Buffer bytes) int
When overridden in a derived class, calculates the number of characters produced by decoding all the bytes in the specified byte array.
getString(Uint8Buffer bytes) String
Decodes the bytes in the specified byte array into a string.
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