@@ -392,9 +392,9 @@ deprecated: v6.0.0
392
392
393
393
* ` size ` {Integer} The desired length of the new ` Buffer `
394
394
395
- Allocates a new ` Buffer ` of ` size ` bytes. The ` size ` must be less than or equal
396
- to the value of [ ` buffer.kMaxLength ` ] . Otherwise , a [ ` RangeError ` ] is thrown.
397
- A zero-length ` Buffer ` will be created if ` size <= 0 ` .
395
+ Allocates a new ` Buffer ` of ` size ` bytes. If the ` size ` is larger than
396
+ [ ` buffer.kMaxLength ` ] or smaller than 0 , a [ ` RangeError ` ] will be thrown.
397
+ A zero-length ` Buffer ` will be created if ` size ` is 0 .
398
398
399
399
Unlike [ ` ArrayBuffers ` ] [ `ArrayBuffer` ] , the underlying memory for ` Buffer ` instances
400
400
created in this way is * not initialized* . The contents of a newly created ` Buffer `
@@ -470,9 +470,9 @@ const buf = Buffer.alloc(5);
470
470
console .log (buf);
471
471
```
472
472
473
- The ` size ` must be less than or equal to the value of [ ` buffer.kMaxLength ` ] .
474
- Otherwise, a [ ` RangeError ` ] is thrown. A zero-length ` Buffer ` will be created if
475
- ` size <= 0 ` .
473
+ Allocates a new ` Buffer ` of ` size ` bytes. If the ` size ` is larger than
474
+ [ ` buffer.kMaxLength ` ] or smaller than 0, a [ ` RangeError ` ] will be thrown.
475
+ A zero-length ` Buffer ` will be created if ` size ` is 0 .
476
476
477
477
If ` fill ` is specified, the allocated ` Buffer ` will be initialized by calling
478
478
[ ` buf.fill(fill) ` ] [ `buf.fill()` ] .
@@ -511,9 +511,9 @@ added: v5.10.0
511
511
512
512
* ` size ` {Integer} The desired length of the new ` Buffer `
513
513
514
- Allocates a new * non-zero-filled * ` Buffer ` of ` size ` bytes. The ` size ` must
515
- be less than or equal to the value of [ ` buffer.kMaxLength ` ] . Otherwise, a
516
- [ ` RangeError ` ] is thrown. A zero-length ` Buffer ` will be created if ` size <= 0 ` .
514
+ Allocates a new ` Buffer ` of ` size ` bytes. If the ` size ` is larger than
515
+ [ ` buffer.kMaxLength ` ] or smaller than 0, a [ ` RangeError ` ] will be thrown.
516
+ A zero-length ` Buffer ` will be created if ` size ` is 0 .
517
517
518
518
The underlying memory for ` Buffer ` instances created in this way is * not
519
519
initialized* . The contents of the newly created ` Buffer ` are unknown and
@@ -557,10 +557,9 @@ added: v5.10.0
557
557
558
558
* ` size ` {Integer} The desired length of the new ` Buffer `
559
559
560
- Allocates a new * non-zero-filled* and non-pooled ` Buffer ` of ` size ` bytes. The
561
- ` size ` must be less than or equal to the value of [ ` buffer.kMaxLength ` ] .
562
- Otherwise, a [ ` RangeError ` ] is thrown. A zero-length ` Buffer ` will be created if
563
- ` size <= 0 ` .
560
+ Allocates a new ` Buffer ` of ` size ` bytes. If the ` size ` is larger than
561
+ [ ` buffer.kMaxLength ` ] or smaller than 0, a [ ` RangeError ` ] will be thrown.
562
+ A zero-length ` Buffer ` will be created if ` size ` is 0.
564
563
565
564
The underlying memory for ` Buffer ` instances created in this way is * not
566
565
initialized* . The contents of the newly created ` Buffer ` are unknown and
@@ -2390,9 +2389,9 @@ deprecated: v6.0.0
2390
2389
2391
2390
* ` size ` {Integer} The desired length of the new ` SlowBuffer `
2392
2391
2393
- Allocates a new ` SlowBuffer ` of ` size ` bytes. The ` size ` must be less than
2394
- or equal to the value of [ ` buffer.kMaxLength ` ] . Otherwise , a [ ` RangeError ` ] is
2395
- thrown. A zero-length ` Buffer ` will be created if ` size <= 0 ` .
2392
+ Allocates a new ` Buffer ` of ` size ` bytes. If the ` size ` is larger than
2393
+ [ ` buffer.kMaxLength ` ] or smaller than 0 , a [ ` RangeError ` ] will be thrown.
2394
+ A zero-length ` Buffer ` will be created if ` size ` is 0 .
2396
2395
2397
2396
The underlying memory for ` SlowBuffer ` instances is * not initialized* . The
2398
2397
contents of a newly created ` SlowBuffer ` are unknown and could contain
0 commit comments