writeFp32Bits method

void writeFp32Bits(
  1. int id,
  2. int bits
)

Writes an fp32 field from its raw 32-bit IEEE-754 bit pattern (the low 32 bits of bits), bypassing the float widening that writeFp32 performs.

Use this when a value must survive bit-for-bit — notably a signaling NaN, whose "is-quiet" bit a Dart double (64-bit) would set on the way in. The corelib never inspects or normalizes a float (CORELIB_PLAN §4.6), so the four bytes are emitted exactly as given.

Implementation

void writeFp32Bits(int id, int bits) {
  _writeHeaderAndVarint(id, WireType.fixlen, (4 << 3) | FixlenType.fp32);
  _putUint32(bits & 0xFFFFFFFF);
}