readUint16 method Null safety

int readUint16()

Read a 16-bit word from the stream.

Implementation

int readUint16() {
  final b1 = buffer[offset++] & 0xff;
  final b2 = buffer[offset++] & 0xff;
  if (byteOrder == BIG_ENDIAN) {
    return (b1 << 8) | b2;
  }
  return (b2 << 8) | b1;
}