readShort method

int readShort()

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

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

Implementation

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