getWriteLength method

  1. @override
int getWriteLength ()
override

Gets the length of the payload in bytes when written to a stream.

Implementation

@override
int getWriteLength() {
  var length = 0;
  final enc = MqttEncoding();
  subscriptions.forEach((String key, MqttQos value) {
    length += enc.getByteCount(key);
    length += 1;
  });
  return length;
}