@@ -1033,7 +1033,8 @@ console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
1033
1033
1034
1034
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1035
1035
format (` writeDoubleBE() ` writes big endian, ` writeDoubleLE() ` writes little
1036
- endian). The ` value ` argument must be a valid 64-bit double.
1036
+ endian). The ` value ` argument * should* be a valid 64-bit double. Behavior is
1037
+ not defined when ` value ` is anything other than a 64-bit double.
1037
1038
1038
1039
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1039
1040
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1065,7 +1066,7 @@ console.log(buf);
1065
1066
1066
1067
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1067
1068
format (` writeFloatBE() ` writes big endian, ` writeFloatLE() ` writes little
1068
- endian). Behavior is unspecified if ` value ` is anything other than a 32-bit
1069
+ endian). Behavior is not defined when ` value ` is anything other than a 32-bit
1069
1070
float.
1070
1071
1071
1072
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
@@ -1095,8 +1096,9 @@ console.log(buf);
1095
1096
* ` noAssert ` {Boolean} Default: false
1096
1097
* Return: {Number} The offset plus the number of written bytes
1097
1098
1098
- Writes ` value ` to the Buffer at the specified ` offset ` . The ` value ` must be a
1099
- valid signed 8-bit integer.
1099
+ Writes ` value ` to the Buffer at the specified ` offset ` . The ` value ` should be a
1100
+ valid signed 8-bit integer. Behavior is not defined when ` value ` is anything
1101
+ other than a signed 8-bit integer.
1100
1102
1101
1103
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1102
1104
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1123,7 +1125,8 @@ console.log(buf);
1123
1125
1124
1126
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1125
1127
format (` writeInt16BE() ` writes big endian, ` writeInt16LE() ` writes little
1126
- endian). The ` value ` must be a valid signed 16-bit integer.
1128
+ endian). The ` value ` should be a valid signed 16-bit integer. Behavior is
1129
+ not defined when ` value ` is anything other than a signed 16-bit integer.
1127
1130
1128
1131
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1129
1132
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1150,7 +1153,8 @@ console.log(buf);
1150
1153
1151
1154
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1152
1155
format (` writeInt32BE() ` writes big endian, ` writeInt32LE() ` writes little
1153
- endian). The ` value ` must be a valid signed 32-bit integer.
1156
+ endian). The ` value ` should be a valid signed 32-bit integer. Behavior is
1157
+ not defined when ` value ` is anything other than a signed 32-bit integer.
1154
1158
1155
1159
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1156
1160
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1196,15 +1200,18 @@ that `value` may be too large for the specific function and `offset` may be
1196
1200
beyond the end of the Buffer leading to the values being silently dropped. This
1197
1201
should not be used unless you are certain of correctness.
1198
1202
1203
+ Behavior is not defined when ` value ` is anything other than an integer.
1204
+
1199
1205
### buf.writeUInt8(value, offset[ , noAssert] )
1200
1206
1201
1207
* ` value ` {Number} Bytes to be written to Buffer
1202
1208
* ` offset ` {Number} ` 0 <= offset <= buf.length - 1 `
1203
1209
* ` noAssert ` {Boolean} Default: false
1204
1210
* Return: {Number} The offset plus the number of written bytes
1205
1211
1206
- Writes ` value ` to the Buffer at the specified ` offset ` . The ` value ` must be a
1207
- valid unsigned 8-bit integer.
1212
+ Writes ` value ` to the Buffer at the specified ` offset ` . The ` value ` should be a
1213
+ valid unsigned 8-bit integer. Behavior is not defined when ` value ` is anything
1214
+ other than an unsigned 8-bit integer.
1208
1215
1209
1216
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1210
1217
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1234,7 +1241,8 @@ console.log(buf);
1234
1241
1235
1242
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1236
1243
format (` writeUInt16BE() ` writes big endian, ` writeUInt16LE() ` writes little
1237
- endian). The ` value ` must be a valid unsigned 16-bit integer.
1244
+ endian). The ` value ` should be a valid unsigned 16-bit integer. Behavior is
1245
+ not defined when ` value ` is anything other than an unsigned 16-bit integer.
1238
1246
1239
1247
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1240
1248
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1268,7 +1276,8 @@ console.log(buf);
1268
1276
1269
1277
Writes ` value ` to the Buffer at the specified ` offset ` with specified endian
1270
1278
format (` writeUInt32BE() ` writes big endian, ` writeUInt32LE() ` writes little
1271
- endian). The ` value ` must be a valid unsigned 32-bit integer.
1279
+ endian). The ` value ` should be a valid unsigned 32-bit integer. Behavior is
1280
+ not defined when ` value ` is anything other than an unsigned 32-bit integer.
1272
1281
1273
1282
Set ` noAssert ` to true to skip validation of ` value ` and ` offset ` . This means
1274
1283
that ` value ` may be too large for the specific function and ` offset ` may be
@@ -1314,6 +1323,8 @@ that `value` may be too large for the specific function and `offset` may be
1314
1323
beyond the end of the Buffer leading to the values being silently dropped. This
1315
1324
should not be used unless you are certain of correctness.
1316
1325
1326
+ Behavior is not defined when ` value ` is anything other than an unsigned integer.
1327
+
1317
1328
## buffer.INSPECT_MAX_BYTES
1318
1329
1319
1330
* {Number} Default: 50
0 commit comments