getWriteLength method

  1. @override
int getWriteLength()
override

Gets the length of the write data when WriteTo will be called.

Implementation

@override
int getWriteLength() {
  var headerLength = 0;
  headerLength += _enc.byteCount(topicName);
  if (header!.qos == MqttQos.atLeastOnce ||
      header!.qos == MqttQos.exactlyOnce) {
    headerLength += 2;
  }
  headerLength += _propertySet.getWriteLength();
  return headerLength;
}