readUint16 method

int readUint16(
  1. [Endian endian = Endian.big]
)

Reads a 16-bit unsigned integer. Increments index by 2.

Implementation

int readUint16([Endian endian = Endian.big]) {
  final byteData = this._byteData;
  final index = this.index;
  final newIndex = index + 2;
  if (newIndex > byteData.lengthInBytes) {
    throw _eofException(index, "uint16");
  }
  final value = _byteData.getUint16(index, endian);
  this.index = index + 2;
  return value;
}