getFloatAt method
Read float with specified endianness
offset
: The offset to read frombytes
: The number of bytes to readendian
: The endianness to use Returns the float value read
Implementation
double getFloatAt(int offset, int bytes, StructEndian endian) {
switch (bytes) {
case 4:
return getFloat32(offset, endian.toEndian());
case 8:
return getFloat64(offset, endian.toEndian());
default:
throw ArgumentError('Unsupported float size: $bytes bytes');
}
}