readFrom method

  1. @override
void readFrom (
  1. MqttByteBuffer payloadStream
)
override

Creates a payload from the specified header stream.

Implementation

@override
void readFrom(MqttByteBuffer payloadStream) {
  var payloadBytesRead = 0;
  final payloadLength = header.messageSize - variableHeader.length;
  // Read the qos grants from the message payload
  while (payloadBytesRead < payloadLength) {
    final granted = MqttUtilities.getQosLevel(payloadStream.readByte());
    payloadBytesRead++;
    addGrant(granted);
  }
}