readUnsignedByte method

int readUnsignedByte (
  1. [bool eofException = true]
)

Returns the byte(0-255) at offset. if eofException is false then if it reaches the end of the stream it will return -1, Otherwise it will throw an exception.

Implementation

int readUnsignedByte([bool eofException = true]) {
  if (offset < fileLength) {
    return view.getUint8(_offset++);
  } else if (eofException)
    throw RangeError("Reached end of file");
  else
    return -129;
}