writeFloatBe

fun ByteArray.writeFloatBe(offset: Int, value: Float)

Writes a 32-bit IEEE 754 float in big-endian order starting at offset.

The value is converted with Float.toRawBits, which preserves the exact bit pattern including NaN payloads, and stored as with writeIntBe. The array is modified in place.

Parameters

offset

the index of the first byte to write.

value

the value to encode.

Throws

if offset is negative or offset + 4 exceeds the array size.