readUint32 method Null safety

  1. @override
int readUint32()
override

Read a 32-bit word from the stream.

Implementation

@override
int readUint32() {
  final b1 = buffer[offset++] & 0xff;
  final b2 = buffer[offset++] & 0xff;
  final b3 = buffer[offset++] & 0xff;
  final b4 = buffer[offset++] & 0xff;
  if (byteOrder == BIG_ENDIAN) {
    return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
  }
  return (b4 << 24) | (b3 << 16) | (b2 << 8) | b1;
}