encodeSelfCapacity method

  1. @override
int encodeSelfCapacity()

Returns an estimated maximum number of bytes required for encoding.

Implementation

@override
int encodeSelfCapacity() {
  var optionsLength = optionsByteData.lengthInBytes;
  while (optionsLength % 4 != 0) {
    optionsLength++;
  }
  var n = 20;
  n += optionsLength;
  n += payload.encodeSelfCapacity();
  return n;
}