readUnsignedShort method

int readUnsignedShort()

Reads and returns a 2-byte unsigned integer decoded with the current endian setting.

Throws EOFException if EOF is reached before the needed bytes are read.

Implementation

int readUnsignedShort() {
  if (seek + 2 > _source.lengthInBytes) {
    throw EOFException('Attempt to read beyond end of input');
  } else {
    final result = _asByteData.getUint16(seek, endian);
    seek += 2;
    return result;
  }
}