MqttHeader class

Represents the Fixed Header of an MQTT message.

Constructors

MqttHeader()
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.

Properties

duplicate bool
Gets or sets a value indicating whether this MQTT Message is duplicate of a previous message. True if duplicate; otherwise, false.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
messageSize int
Gets or sets the size of the variable header + payload section of the message. The size of the variable header + payload.
getter/setter pair
messageType MqttMessageType?
Gets or sets the type of the MQTT message.
getter/setter pair
qos MqttQos
Gets or sets the Quality of Service indicator for the message.
getter/setter pair
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.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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 nonexistent method or property is accessed.
inherited
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.
override
withQos(MqttQos qos) MqttHeader
Sets the Qos of the message header.
writeTo(int messageSize, MqttByteBuffer messageStream) → void
Writes the header to a supplied stream.

Operators

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

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