encodeSelfCapacity method

  1. @override
int encodeSelfCapacity()
override

Returns an estimate of the maximum number of bytes needed to encode this value.

Implementation

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