MqttByteBuffer class

Utility class to allow stream like access to a sized byte buffer. This class is in effect a cut-down implementation of the C# NET System.IO class with Mqtt client specific extensions.

Constructors

MqttByteBuffer(Uint8Buffer? buffer)
The byte buffer
MqttByteBuffer.fromList(List<int> data)
From a list

Properties

availableBytes int
Available bytes
no setter
buffer ↔ Uint8Buffer?
The underlying byte buffer
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
length int
Length
no setter
position int
Position
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
skipBytes int
Skip bytes
no getter

Methods

addAll(List<int> data) → void
Add a list
isMessageAvailable() bool
Message available
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(int count) → Uint8Buffer
Reads a sequence of bytes from the current buffer and advances the position within the buffer by the number of bytes read.
readByte() int
Reads a byte from the buffer and advances the position within the buffer by one byte, or returns -1 if at the end of the buffer.
readMqttStringM() String
Reads an MQTT string from the underlying stream member
readShort() int
Read a short int(16 bits)
reset() → void
Resets the position to 0
seek(int seek) → void
Seek. Sets the position in the buffer. If overflow occurs the position is set to the end of the buffer.
shrink() → void
Shrink the buffer
toString() String
A string representation of this object.
override
write(Uint8Buffer? buffer) → void
Writes a sequence of bytes to the current buffer and advances the position within the buffer by the number of bytes written.
writeByte(int byte) → void
Writes a byte to the current position in the buffer and advances the position within the buffer by one byte.
writeMqttStringM(String stringToWrite) → void
Writes an MQTT string member
writeShort(int short) → void
Write a short(16 bit)

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

readMqttString(MqttByteBuffer buffer) String
Reads an MQTT string from the underlying stream.
writeMqttString(MqttByteBuffer stringStream, String stringToWrite) → void
Writes an MQTT string. stringStream - The stream containing the string to write. stringToWrite - The string to write.