getIntAt method
Read integer with specified endianness
offset: The offset to read frombytes: The number of bytes to readendian: The endianness to use Returns the integer value read
Implementation
int getIntAt(int offset, int bytes, StructEndian endian) {
switch (bytes) {
case 1:
return getInt8(offset);
case 2:
return getInt16(offset, endian.toEndian());
case 4:
return getInt32(offset, endian.toEndian());
case 8:
return getInt64(offset, endian.toEndian());
default:
throw ArgumentError('Unsupported integer size: $bytes bytes');
}
}