readUint64 method Null safety

  1. @override
int readUint64()
override

Read a 64-bit word form the stream.

Implementation

@override
int readUint64() {
  var b1 = 0;
  var b2 = 0;
  var b3 = 0;
  var b4 = 0;
  var b5 = 0;
  var b6 = 0;
  var b7 = 0;
  var b8 = 0;
  if ((_bufferPosition + 8) < _bufferSize) {
    b1 = _buffer[_bufferPosition++] & 0xff;
    b2 = _buffer[_bufferPosition++] & 0xff;
    b3 = _buffer[_bufferPosition++] & 0xff;
    b4 = _buffer[_bufferPosition++] & 0xff;
    b5 = _buffer[_bufferPosition++] & 0xff;
    b6 = _buffer[_bufferPosition++] & 0xff;
    b7 = _buffer[_bufferPosition++] & 0xff;
    b8 = _buffer[_bufferPosition++] & 0xff;
    _position += 8;
  } else {
    b1 = readByte();
    b2 = readByte();
    b3 = readByte();
    b4 = readByte();
    b5 = readByte();
    b6 = readByte();
    b7 = readByte();
    b8 = readByte();
  }

  if (byteOrder == BIG_ENDIAN) {
    return (b1 << 56) |
        (b2 << 48) |
        (b3 << 40) |
        (b4 << 32) |
        (b5 << 24) |
        (b6 << 16) |
        (b7 << 8) |
        b8;
  }
  return (b8 << 56) |
      (b7 << 48) |
      (b6 << 40) |
      (b5 << 32) |
      (b4 << 24) |
      (b3 << 16) |
      (b2 << 8) |
      b1;
}