readInt method

int readInt()

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

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

Implementation

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