MqttHeader class Null safety

Represents the Fixed Header of an MQTT message.


Initializes a new instance of the MqttHeader class.
MqttHeader.fromByteBuffer(MqttByteBuffer headerStream)
Initializes a new instance of MqttHeader' based on data contained within the supplied stream.


duplicate bool
Gets or sets a value indicating whether this MQTT Message is duplicate of a previous message. True if duplicate; otherwise, false.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
messageSize int
Gets or sets the size of the variable header + payload section of the message. The size of the variable header + payload.
read / write
messageType MqttMessageType?
Gets or sets the type of the MQTT message.
read / write
qos MqttQos
Gets or sets the Quality of Service indicator for the message.
read / write
retain bool
Gets or sets a value indicating whether this MQTT message should be retained by the message broker for transmission to new subscribers. True if message should be retained by the message broker; otherwise, false.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


asType(MqttMessageType messageType) MqttHeader
Sets the type of the message identified in the header.
getRemainingLengthBytes() Uint8Buffer
Calculates and return the bytes that represent the remaining length of the message.
headerBytes() Uint8Buffer
Gets the value of the Mqtt header as a byte array
isDuplicate() MqttHeader
Sets the IsDuplicate flag of the header.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
readFrom(MqttByteBuffer headerStream) → void
Creates a new MqttHeader based on a list of bytes.
shouldBeRetained() MqttHeader
Defines that the message should be retained.
toString() String
A string representation of this object. [...]
withQos(MqttQos qos) MqttHeader
Sets the Qos of the message header.
writeTo(int messageSize, MqttByteBuffer messageStream) → void
Writes the header to a supplied stream.


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

Static Methods

calculateLength(Uint8Buffer lengthBytes) int
Calculates the remaining length of an MqttMessage from the bytes that make up the length.
readLengthBytes(MqttByteBuffer headerStream) Uint8Buffer
Reads the length bytes of an MqttHeader from the supplied stream.
readRemainingLength(MqttByteBuffer headerStream) int
Get the remaining byte length in the buffer