MqttUtf8Encoding class
Encoding implementation that can encode and decode strings in the MQTT UTF8 string format.
Text fields within the MQTT Control Packets are encoded as UTF-8 strings.
UTF-8 RFC3629
is an efficient encoding of Unicode Unicode
characters that
optimizes the encoding of ASCII characters in support of text-based communications.
Each of these strings is prefixed with a two byte integer length field that gives the number of bytes in a UTF-8 encoded string itself. Consequently, the maximum size of a UTF-8 encoded string is 65,535 bytes.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
byteCount(
String chars) → int - Gets the total length of a UTF8 encoded string including the length bytes
-
fromUtf8(
Uint8Buffer bytes) → String - Decodes the bytes in the specified MQTT UTF8 encoded byte array into a string.
-
length(
Uint8Buffer bytes) → int - Gets the length of a UTF8 encoded string from the length bytes
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
toUtf8(
String s) → Uint8Buffer - Encodes all the characters in the specified string into a sequence of bytes.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited