@@ -604,6 +604,9 @@ a developer has observed undue memory retention in their applications.
604
604
A ` TypeError ` will be thrown if ` size ` is not a number.
605
605
606
606
### Class Method: Buffer.byteLength(string[ , encoding] )
607
+ <!-- YAML
608
+ added: v0.1.90
609
+ -->
607
610
608
611
* ` string ` {String | Buffer | TypedArray | DataView | ArrayBuffer} A value to
609
612
calculate the length of
@@ -698,7 +701,7 @@ console.log(bufA.length);
698
701
699
702
### Class Method: Buffer.from(array)
700
703
<!-- YAML
701
- added: v3.0 .0
704
+ added: v5.10 .0
702
705
-->
703
706
704
707
* ` array ` {Array}
@@ -767,7 +770,7 @@ A `TypeError` will be thrown if `arrayBuffer` is not an [`ArrayBuffer`].
767
770
768
771
### Class Method: Buffer.from(buffer)
769
772
<!-- YAML
770
- added: v3.0 .0
773
+ added: v5.10 .0
771
774
-->
772
775
773
776
* ` buffer ` {Buffer} An existing ` Buffer ` to copy data from
@@ -823,6 +826,9 @@ console.log(buf2.toString());
823
826
A ` TypeError ` will be thrown if ` str ` is not a string.
824
827
825
828
### Class Method: Buffer.isBuffer(obj)
829
+ <!-- YAML
830
+ added: v0.1.101
831
+ -->
826
832
827
833
* ` obj ` {Object}
828
834
* Return: {Boolean}
@@ -951,6 +957,9 @@ A `RangeError` will be thrown if: `targetStart < 0`, `sourceStart < 0`,
951
957
` targetEnd > target.byteLength ` or ` sourceEnd > source.byteLength ` .
952
958
953
959
### buf.copy(target[ , targetStart[ , sourceStart[ , sourceEnd]]] )
960
+ <!-- YAML
961
+ added: v0.1.90
962
+ -->
954
963
955
964
* ` target ` {Buffer} A ` Buffer ` to copy into.
956
965
* ` targetStart ` {Integer} The offset within ` target ` at which to begin
@@ -1028,7 +1037,7 @@ for (var pair of buf.entries()) {
1028
1037
1029
1038
### buf.equals(otherBuffer)
1030
1039
<!-- YAML
1031
- added: v1.0.0
1040
+ added: v0.11.13
1032
1041
-->
1033
1042
1034
1043
* ` otherBuffer ` {Buffer} A ` Buffer ` to compare to
@@ -1264,6 +1273,9 @@ console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'ucs2'));
1264
1273
```
1265
1274
1266
1275
### buf.length
1276
+ <!-- YAML
1277
+ added: v0.1.90
1278
+ -->
1267
1279
1268
1280
* {Integer}
1269
1281
@@ -1307,6 +1319,9 @@ console.log(buf.length);
1307
1319
1308
1320
### buf.readDoubleBE(offset[ , noAssert] )
1309
1321
### buf.readDoubleLE(offset[ , noAssert] )
1322
+ <!-- YAML
1323
+ added: v0.11.15
1324
+ -->
1310
1325
1311
1326
* ` offset ` {Integer} Where to start reading. Must satisfy: ` 0 <= offset <= buf.length - 8 `
1312
1327
* ` noAssert ` {Boolean} Skip ` offset ` validation? ** Default:** ` false `
@@ -1340,6 +1355,9 @@ console.log(buf.readDoubleLE(1, true));
1340
1355
1341
1356
### buf.readFloatBE(offset[ , noAssert] )
1342
1357
### buf.readFloatLE(offset[ , noAssert] )
1358
+ <!-- YAML
1359
+ added: v0.11.15
1360
+ -->
1343
1361
1344
1362
* ` offset ` {Integer} Where to start reading. Must satisfy: ` 0 <= offset <= buf.length - 4 `
1345
1363
* ` noAssert ` {Boolean} Skip ` offset ` validation? ** Default:** ` false `
@@ -1372,6 +1390,9 @@ console.log(buf.readFloatLE(1, true));
1372
1390
```
1373
1391
1374
1392
### buf.readInt8(offset[ , noAssert] )
1393
+ <!-- YAML
1394
+ added: v0.5.0
1395
+ -->
1375
1396
1376
1397
* ` offset ` {Integer} Where to start reading. Must satisfy: ` 0 <= offset <= buf.length - 1 `
1377
1398
* ` noAssert ` {Boolean} Skip ` offset ` validation? ** Default:** ` false `
@@ -1401,6 +1422,9 @@ console.log(buf.readInt8(2));
1401
1422
1402
1423
### buf.readInt16BE(offset[ , noAssert] )
1403
1424
### buf.readInt16LE(offset[ , noAssert] )
1425
+ <!-- YAML
1426
+ added: v0.5.5
1427
+ -->
1404
1428
1405
1429
* ` offset ` {Integer} Where to start reading. Must satisfy: ` 0 <= offset <= buf.length - 2 `
1406
1430
* ` noAssert ` {Boolean} Skip ` offset ` validation? ** Default:** ` false `
@@ -1432,6 +1456,9 @@ console.log(buf.readInt16LE(1));
1432
1456
1433
1457
### buf.readInt32BE(offset[ , noAssert] )
1434
1458
### buf.readInt32LE(offset[ , noAssert] )
1459
+ <!-- YAML
1460
+ added: v0.5.5
1461
+ -->
1435
1462
1436
1463
* ` offset ` {Integer} Where to start reading. Must satisfy: ` 0 <= offset <= buf.length - 4 `
1437
1464
* ` noAssert ` {Boolean} Skip ` offset ` validation? ** Default:** ` false `
@@ -1464,7 +1491,7 @@ console.log(buf.readInt32LE(1));
1464
1491
### buf.readIntBE(offset, byteLength[ , noAssert] )
1465
1492
### buf.readIntLE(offset, byteLength[ , noAssert] )
1466
1493
<!-- YAML
1467
- added: v1.0.0
1494
+ added: v0.11.15
1468
1495
-->
1469
1496
1470
1497
* ` offset ` {Integer} Where to start reading. Must satisfy: ` 0 <= offset <= buf.length - byteLength `
@@ -1495,6 +1522,9 @@ console.log(buf.readIntBE(1, 6).toString(16));
1495
1522
```
1496
1523
1497
1524
### buf.readUInt8(offset[ , noAssert] )
1525
+ <!-- YAML
1526
+ added: v0.5.0
1527
+ -->
1498
1528
1499
1529
* ` offset ` {Integer} Where to start reading. Must satisfy: ` 0 <= offset <= buf.length - 1 `
1500
1530
* ` noAssert ` {Boolean} Skip ` offset ` validation? ** Default:** ` false `
@@ -1522,6 +1552,9 @@ console.log(buf.readUInt8(2));
1522
1552
1523
1553
### buf.readUInt16BE(offset[ , noAssert] )
1524
1554
### buf.readUInt16LE(offset[ , noAssert] )
1555
+ <!-- YAML
1556
+ added: v0.5.5
1557
+ -->
1525
1558
1526
1559
* ` offset ` {Integer} Where to start reading. Must satisfy: ` 0 <= offset <= buf.length - 2 `
1527
1560
* ` noAssert ` {Boolean} Skip ` offset ` validation? ** Default:** ` false `
@@ -1557,6 +1590,9 @@ console.log(buf.readUInt16LE(2).toString(16));
1557
1590
1558
1591
### buf.readUInt32BE(offset[ , noAssert] )
1559
1592
### buf.readUInt32LE(offset[ , noAssert] )
1593
+ <!-- YAML
1594
+ added: v0.5.5
1595
+ -->
1560
1596
1561
1597
* ` offset ` {Integer} Where to start reading. Must satisfy: ` 0 <= offset <= buf.length - 4 `
1562
1598
* ` noAssert ` {Boolean} Skip ` offset ` validation? ** Default:** ` false `
@@ -1587,7 +1623,7 @@ console.log(buf.readUInt32LE(1).toString(16));
1587
1623
### buf.readUIntBE(offset, byteLength[ , noAssert] )
1588
1624
### buf.readUIntLE(offset, byteLength[ , noAssert] )
1589
1625
<!-- YAML
1590
- added: v1.0.0
1626
+ added: v0.11.15
1591
1627
-->
1592
1628
1593
1629
* ` offset ` {Integer} Where to start reading. Must satisfy: ` 0 <= offset <= buf.length - byteLength `
@@ -1618,6 +1654,9 @@ console.log(buf.readUIntBE(1, 6).toString(16));
1618
1654
```
1619
1655
1620
1656
### buf.slice([ start[ , end]] )
1657
+ <!-- YAML
1658
+ added: v0.3.0
1659
+ -->
1621
1660
1622
1661
* ` start ` {Integer} Where the new ` Buffer ` will start. ** Default:** ` 0 `
1623
1662
* ` end ` {Integer} Where the new ` Buffer ` will end (not inclusive).
@@ -1767,6 +1806,9 @@ Note that JavaScript cannot encode 64-bit integers. This method is intended
1767
1806
for working with 64-bit floats.
1768
1807
1769
1808
### buf.toString([ encoding[ , start[ , end]]] )
1809
+ <!-- YAML
1810
+ added: v0.1.90
1811
+ -->
1770
1812
1771
1813
* ` encoding ` {String} The character encoding to decode to. ** Default:** ` 'utf8' `
1772
1814
* ` start ` {Integer} Where to start decoding. ** Default:** ` 0 `
@@ -1870,6 +1912,9 @@ for (var value of buf) {
1870
1912
```
1871
1913
1872
1914
### buf.write(string[ , offset[ , length]] [ , encoding ] )
1915
+ <!-- YAML
1916
+ added: v0.1.90
1917
+ -->
1873
1918
1874
1919
* ` string ` {String} String to be written to ` buf `
1875
1920
* ` offset ` {Integer} Where to start writing ` string ` . ** Default:** ` 0 `
@@ -1895,6 +1940,9 @@ console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);
1895
1940
1896
1941
### buf.writeDoubleBE(value, offset[ , noAssert] )
1897
1942
### buf.writeDoubleLE(value, offset[ , noAssert] )
1943
+ <!-- YAML
1944
+ added: v0.11.15
1945
+ -->
1898
1946
1899
1947
* ` value ` {Number} Number to be written to ` buf `
1900
1948
* ` offset ` {Integer} Where to start writing. Must satisfy: ` 0 <= offset <= buf.length - 8 `
@@ -1927,6 +1975,9 @@ console.log(buf);
1927
1975
1928
1976
### buf.writeFloatBE(value, offset[ , noAssert] )
1929
1977
### buf.writeFloatLE(value, offset[ , noAssert] )
1978
+ <!-- YAML
1979
+ added: v0.11.15
1980
+ -->
1930
1981
1931
1982
* ` value ` {Number} Number to be written to ` buf `
1932
1983
* ` offset ` {Integer} Where to start writing. Must satisfy: ` 0 <= offset <= buf.length - 4 `
@@ -1958,6 +2009,9 @@ console.log(buf);
1958
2009
```
1959
2010
1960
2011
### buf.writeInt8(value, offset[ , noAssert] )
2012
+ <!-- YAML
2013
+ added: v0.5.0
2014
+ -->
1961
2015
1962
2016
* ` value ` {Integer} Number to be written to ` buf `
1963
2017
* ` offset ` {Integer} Where to start writing. Must satisfy: ` 0 <= offset <= buf.length - 1 `
@@ -1987,6 +2041,9 @@ console.log(buf);
1987
2041
1988
2042
### buf.writeInt16BE(value, offset[ , noAssert] )
1989
2043
### buf.writeInt16LE(value, offset[ , noAssert] )
2044
+ <!-- YAML
2045
+ added: v0.5.5
2046
+ -->
1990
2047
1991
2048
* ` value ` {Integer} Number to be written to ` buf `
1992
2049
* ` offset ` {Integer} Where to start writing. Must satisfy: ` 0 <= offset <= buf.length - 2 `
@@ -2017,6 +2074,9 @@ console.log(buf);
2017
2074
2018
2075
### buf.writeInt32BE(value, offset[ , noAssert] )
2019
2076
### buf.writeInt32LE(value, offset[ , noAssert] )
2077
+ <!-- YAML
2078
+ added: v0.5.5
2079
+ -->
2020
2080
2021
2081
* ` value ` {Integer} Number to be written to ` buf `
2022
2082
* ` offset ` {Integer} Where to start writing. Must satisfy: ` 0 <= offset <= buf.length - 4 `
@@ -2048,7 +2108,7 @@ console.log(buf);
2048
2108
### buf.writeIntBE(value, offset, byteLength[ , noAssert] )
2049
2109
### buf.writeIntLE(value, offset, byteLength[ , noAssert] )
2050
2110
<!-- YAML
2051
- added: v1.0.0
2111
+ added: v0.11.15
2052
2112
-->
2053
2113
2054
2114
* ` value ` {Integer} Number to be written to ` buf `
@@ -2082,6 +2142,9 @@ console.log(buf);
2082
2142
```
2083
2143
2084
2144
### buf.writeUInt8(value, offset[ , noAssert] )
2145
+ <!-- YAML
2146
+ added: v0.5.0
2147
+ -->
2085
2148
2086
2149
* ` value ` {Integer} Number to be written to ` buf `
2087
2150
* ` offset ` {Integer} Where to start writing. Must satisfy: ` 0 <= offset <= buf.length - 1 `
@@ -2111,6 +2174,9 @@ console.log(buf);
2111
2174
2112
2175
### buf.writeUInt16BE(value, offset[ , noAssert] )
2113
2176
### buf.writeUInt16LE(value, offset[ , noAssert] )
2177
+ <!-- YAML
2178
+ added: v0.5.5
2179
+ -->
2114
2180
2115
2181
* ` value ` {Integer} Number to be written to ` buf `
2116
2182
* ` offset ` {Integer} Where to start writing. Must satisfy: ` 0 <= offset <= buf.length - 2 `
@@ -2145,6 +2211,9 @@ console.log(buf);
2145
2211
2146
2212
### buf.writeUInt32BE(value, offset[ , noAssert] )
2147
2213
### buf.writeUInt32LE(value, offset[ , noAssert] )
2214
+ <!-- YAML
2215
+ added: v0.5.5
2216
+ -->
2148
2217
2149
2218
* ` value ` {Integer} Number to be written to ` buf `
2150
2219
* ` offset ` {Integer} Where to start writing. Must satisfy: ` 0 <= offset <= buf.length - 4 `
@@ -2177,6 +2246,9 @@ console.log(buf);
2177
2246
2178
2247
### buf.writeUIntBE(value, offset, byteLength[ , noAssert] )
2179
2248
### buf.writeUIntLE(value, offset, byteLength[ , noAssert] )
2249
+ <!-- YAML
2250
+ added: v0.5.5
2251
+ -->
2180
2252
2181
2253
* ` value ` {Integer} Number to be written to ` buf `
2182
2254
* ` offset ` {Integer} Where to start writing. Must satisfy: ` 0 <= offset <= buf.length - byteLength `
@@ -2209,6 +2281,9 @@ console.log(buf);
2209
2281
```
2210
2282
2211
2283
## buffer.INSPECT_MAX_BYTES
2284
+ <!-- YAML
2285
+ added: v0.5.4
2286
+ -->
2212
2287
2213
2288
* {Integer} ** Default:** ` 50 `
2214
2289
0 commit comments