calcExt function

int calcExt(
  1. int count
)

E width: count >= 65536 => 4; count >= 2 => 2; else 0.

Implementation

int calcExt(int count) {
  if (count >= 65536) {
    return 4;
  } else if (count >= 2) {
    return 2;
  }
  assert(count == 1, 'packet count error: $count');
  return 0;
}