buf.writeInt32LE(value, offset[, noAssert])
Writes value
to the Buffer at the specified offset
with specified endian format (writeInt32BE()
writes big endian, writeInt32LE()
writes little endian). The value
should be a valid signed 32-bit integer. Behavior is not defined when value
is anything other than a signed 32-bit integer.
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.
The value
is interpreted and written as a two's complement signed integer.
const buf = Buffer.allocUnsafe(8); buf.writeInt32BE(0x01020304,0); buf.writeInt32LE(0x05060708,4); console.log(buf); // Prints: <Buffer 01 02 03 04 08 07 06 05>
Please login to continue.