readUint method Null safety

int readUint(
  1. int byteLength,
  2. [Endian? endian]
)

Implementation

int readUint(int byteLength, [Endian? endian]) {
  switch (byteLength) {
    case 1:
      return readUint8();
    case 2:
      return readUint16(endian);
    case 4:
      return readUint32(endian);
    case 8:
      return readUint64(endian);
    default:
      throw ArgumentError(
          'byteLength ($byteLength) must be one of [1, 2, 4, 8].');
  }
}