@@ -1402,7 +1402,8 @@ console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
1402
1402
1403
1403
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1404
1404
format (` writeDoubleBE() ` writes big endian, ` writeDoubleLE() ` writes little
1405
- endian). The ` value ` argument must be a valid 64-bit double.
1405
+ endian). The ` value ` argument * should* be a valid 64-bit double. Behavior is
1406
+ not defined when ` value ` is anything other than a 64-bit double.
1406
1407
1407
1408
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1408
1409
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1434,7 +1435,7 @@ console.log(buf);
1434
1435
1435
1436
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1436
1437
format (` writeFloatBE() ` writes big endian, ` writeFloatLE() ` writes little
1437
- endian). Behavior is unspecified if ` value ` is anything other than a 32-bit
1438
+ endian). Behavior is not defined when ` value ` is anything other than a 32-bit
1438
1439
float.
1439
1440
1440
1441
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
@@ -1464,8 +1465,9 @@ console.log(buf);
1464
1465
* ` noAssert ` {Boolean} Default: false
1465
1466
* Return: {Number} The offset plus the number of written bytes
1466
1467
1467
- Writes ` value ` to the Buffer at the specified ` offset ` . The ` value ` must be a
1468
- valid signed 8-bit integer.
1468
+ Writes ` value ` to the Buffer at the specified ` offset ` . The ` value ` should be a
1469
+ valid signed 8-bit integer. Behavior is not defined when ` value ` is anything
1470
+ other than a signed 8-bit integer.
1469
1471
1470
1472
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1471
1473
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1492,7 +1494,8 @@ console.log(buf);
1492
1494
1493
1495
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1494
1496
format (` writeInt16BE() ` writes big endian, ` writeInt16LE() ` writes little
1495
- endian). The ` value ` must be a valid signed 16-bit integer.
1497
+ endian). The ` value ` should be a valid signed 16-bit integer. Behavior is
1498
+ not defined when ` value ` is anything other than a signed 16-bit integer.
1496
1499
1497
1500
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1498
1501
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1519,7 +1522,8 @@ console.log(buf);
1519
1522
1520
1523
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1521
1524
format (` writeInt32BE() ` writes big endian, ` writeInt32LE() ` writes little
1522
- endian). The ` value ` must be a valid signed 32-bit integer.
1525
+ endian). The ` value ` should be a valid signed 32-bit integer. Behavior is
1526
+ not defined when ` value ` is anything other than a signed 32-bit integer.
1523
1527
1524
1528
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1525
1529
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1565,15 +1569,18 @@ that `value` may be too large for the specific function and `offset` may be
1565
1569
beyond the end of the Buffer leading to the values being silently dropped. This
1566
1570
should not be used unless you are certain of correctness.
1567
1571
1572
+ Behavior is not defined when ` value ` is anything other than an integer.
1573
+
1568
1574
### buf.writeUInt8(value, offset[ , noAssert] )
1569
1575
1570
1576
* ` value ` {Number} Bytes to be written to Buffer
1571
1577
* ` offset ` {Number} ` 0 <= offset <= buf.length - 1 `
1572
1578
* ` noAssert ` {Boolean} Default: false
1573
1579
* Return: {Number} The offset plus the number of written bytes
1574
1580
1575
- Writes ` value ` to the Buffer at the specified ` offset ` . The ` value ` must be a
1576
- valid unsigned 8-bit integer.
1581
+ Writes ` value ` to the Buffer at the specified ` offset ` . The ` value ` should be a
1582
+ valid unsigned 8-bit integer. Behavior is not defined when ` value ` is anything
1583
+ other than an unsigned 8-bit integer.
1577
1584
1578
1585
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1579
1586
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1603,7 +1610,8 @@ console.log(buf);
1603
1610
1604
1611
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1605
1612
format (` writeUInt16BE() ` writes big endian, ` writeUInt16LE() ` writes little
1606
- endian). The ` value ` must be a valid unsigned 16-bit integer.
1613
+ endian). The ` value ` should be a valid unsigned 16-bit integer. Behavior is
1614
+ not defined when ` value ` is anything other than an unsigned 16-bit integer.
1607
1615
1608
1616
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1609
1617
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1637,7 +1645,8 @@ console.log(buf);
1637
1645
1638
1646
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1639
1647
format (` writeUInt32BE() ` writes big endian, ` writeUInt32LE() ` writes little
1640
- endian). The ` value ` must be a valid unsigned 32-bit integer.
1648
+ endian). The ` value ` should be a valid unsigned 32-bit integer. Behavior is
1649
+ not defined when ` value ` is anything other than an unsigned 32-bit integer.
1641
1650
1642
1651
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1643
1652
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1683,6 +1692,8 @@ that `value` may be too large for the specific function and `offset` may be
1683
1692
beyond the end of the Buffer leading to the values being silently dropped. This
1684
1693
should not be used unless you are certain of correctness.
1685
1694
1695
+ Behavior is not defined when ` value ` is anything other than an unsigned integer.
1696
+
1686
1697
## buffer.INSPECT_MAX_BYTES
1687
1698
1688
1699
* {Number} Default: 50
0 commit comments