buf.writeFloatLE(value, offset[, noAssert])
Writes value
to the Buffer at the specified offset
with specified endian format (writeFloatBE()
writes big endian, writeFloatLE()
writes little endian). Behavior is not defined when value
is anything other than a 32-bit float.
Set noAssert
to true to skip validation of value
and offset
. This means that value
may be too large for the specific function and offset
may be beyond the end of the Buffer leading to the values being silently dropped. This should not be used unless you are certain of correctness.
Example:
const buf = Buffer.allocUnsafe(4); buf.writeFloatBE(0xcafebabe, 0); console.log(buf); // Prints: <Buffer 4f 4a fe bb> buf.writeFloatLE(0xcafebabe, 0); console.log(buf); // Prints: <Buffer bb fe 4a 4f>
Please login to continue.