@@ -3515,16 +3515,18 @@ console.log(buf.toString());
3515
3515
// Also prints: cuffer (!)
3516
3516
```
3517
3517
3518
-
3519
3518
### ` buf.asciiSlice([start[, end]]) `
3520
3519
3521
3520
* ` start ` {integer} The byte offset to start slicing at. ** Default** : 0.
3522
- * ` end ` {integer} The byte offset to stop slicing at (not inclusive). ** Default** : ` buf.length ` .
3521
+ * ` end ` {integer} The byte offset to stop slicing at (not inclusive).
3522
+ ** Default** : ` buf.length ` .
3523
3523
* Returns: {string}
3524
3524
3525
- Decodes buf to a string according ASCII character encoding. ` start ` and ` end ` may be passed to decode only a subset of ` buf ` .
3525
+ Decodes buf to a string according ASCII character encoding. ` start ` and
3526
+ ` end ` may be passed to decode only a subset of ` buf ` .
3526
3527
3527
- In most cases, ` buf.toString() ` is preferable, especially if encoding is variable.
3528
+ In most cases, ` buf.toString() ` is preferable, especially if encoding is
3529
+ variable.
3528
3530
3529
3531
``` mjs
3530
3532
import { Buffer } from ' node:buffer' ;
@@ -3547,10 +3549,12 @@ console.log(buf.asciiSlice(0, 3));
3547
3549
### ` buf.base64Slice([start[, end]]) `
3548
3550
3549
3551
* ` start ` {integer} The byte offset to start slicing at. ** Default** : 0.
3550
- * ` end ` {integer} The byte offset to stop decoding at (not inclusive). ** Default** : ` buf.length ` .
3552
+ * ` end ` {integer} The byte offset to stop decoding at (not inclusive).
3553
+ ** Default** : ` buf.length ` .
3551
3554
* Returns: {string}
3552
3555
3553
- Decodes buf to a string according to base64 character encoding. ` start ` and ` end ` may be passed to decode only a subset of ` buf ` .
3556
+ Decodes buf to a string according to base64 character encoding. ` start ` and
3557
+ ` end ` may be passed to decode only a subset of ` buf ` .
3554
3558
3555
3559
``` mjs
3556
3560
import { Buffer } from ' node:buffer' ;
@@ -3573,10 +3577,12 @@ console.log(buf.base64Slice(0, 3));
3573
3577
### ` buf.base64urlSlice([start[, end]]) `
3574
3578
3575
3579
* ` start ` {integer} The byte offset to start slicing at. ** Default** : 0.
3576
- * ` end ` {integer} The byte offset to stop decoding at (not inclusive). ** Default** : ` buf.length ` .
3580
+ * ` end ` {integer} The byte offset to stop decoding at (not inclusive).
3581
+ ** Default** : ` buf.length ` .
3577
3582
* Returns: {string}
3578
3583
3579
- Decodes buf to a string according to base64url character encoding. ` start ` and ` end ` may be passed to decode only a subset of ` buf ` .
3584
+ Decodes buf to a string according to base64url character encoding. ` start `
3585
+ and ` end ` may be passed to decode only a subset of ` buf ` .
3580
3586
3581
3587
``` mjs
3582
3588
import { Buffer } from ' node:buffer' ;
@@ -3599,10 +3605,12 @@ console.log(buf.base64urlSlice(0, 3));
3599
3605
### ` buf.hexSlice([start[, end]]) `
3600
3606
3601
3607
* ` start ` {integer} The byte offset to start slicing at. ** Default** : 0.
3602
- * ` end ` {integer} The byte offset to stop decoding at (not inclusive). ** Default** : ` buf.length ` .
3608
+ * ` end ` {integer} The byte offset to stop decoding at (not inclusive).
3609
+ ** Default** : ` buf.length ` .
3603
3610
* Returns: {string}
3604
3611
3605
- Decodes buf to a string according to hex character encoding. ` start ` and ` end ` may be passed to decode only a subset of ` buf ` .
3612
+ Decodes buf to a string according to hex character encoding. ` start ` and
3613
+ ` end ` may be passed to decode only a subset of ` buf ` .
3606
3614
3607
3615
``` mjs
3608
3616
import { Buffer } from ' node:buffer' ;
@@ -3625,10 +3633,12 @@ console.log(buf.hexSlice(0, 3));
3625
3633
### ` buf.latin1Slice([start[, end]]) `
3626
3634
3627
3635
* ` start ` {integer} The byte offset to start slicing at. ** Default** : 0.
3628
- * ` end ` {integer} The byte offset to stop slicing at (not inclusive). ** Default** : ` buf.length ` .
3636
+ * ` end ` {integer} The byte offset to stop slicing at (not inclusive).
3637
+ ** Default** : ` buf.length ` .
3629
3638
* Returns: {string}
3630
3639
3631
- Decodes buf to a string according to latin1 character encoding. ` start ` and ` end ` may be passed to decode only a subset of ` buf ` .
3640
+ Decodes buf to a string according to latin1 character encoding. ` start ` and
3641
+ ` end ` may be passed to decode only a subset of ` buf ` .
3632
3642
3633
3643
``` mjs
3634
3644
import { Buffer } from ' node:buffer' ;
@@ -3651,10 +3661,12 @@ console.log(buf.latin1Slice(0, 3));
3651
3661
### ` buf.ucs2Slice([start[, end]]) `
3652
3662
3653
3663
* ` start ` {integer} The byte offset to start slicing at. ** Default** : 0.
3654
- * ` end ` {integer} The byte offset to stop slicing at (not inclusive). ** Default** : ` buf.length ` .
3664
+ * ` end ` {integer} The byte offset to stop slicing at (not inclusive).
3665
+ ** Default** : ` buf.length ` .
3655
3666
* Returns: {string}
3656
3667
3657
- Decodes buf to a string according to UCS-2 character encoding. ` start ` and ` end ` may be passed to decode only a subset of ` buf ` .
3668
+ Decodes buf to a string according to UCS-2 character encoding. ` start ` and
3669
+ ` end ` may be passed to decode only a subset of ` buf ` .
3658
3670
3659
3671
``` mjs
3660
3672
import { Buffer } from ' node:buffer' ;
@@ -3677,10 +3689,12 @@ console.log(buf.ucs2Slice(0, 3));
3677
3689
### ` buf.utf8Slice([start[, end]]) `
3678
3690
3679
3691
* ` start ` {integer} The byte offset to start slicing at. ** Default** : 0.
3680
- * ` end ` {integer} The byte offset to stop slicing at (not inclusive). ** Default** : ` buf.length ` .
3692
+ * ` end ` {integer} The byte offset to stop slicing at (not inclusive).
3693
+ ** Default** : ` buf.length ` .
3681
3694
* Returns: {string}
3682
3695
3683
- Decodes buf to a string according to UTF-8 character encoding. ` start ` and ` end ` may be passed to decode only a subset of ` buf ` .
3696
+ Decodes buf to a string according to UTF-8 character encoding. ` start ` and
3697
+ ` end ` may be passed to decode only a subset of ` buf ` .
3684
3698
3685
3699
``` mjs
3686
3700
import { Buffer } from ' node:buffer' ;
@@ -3703,12 +3717,14 @@ console.log(buf.utf8Slice(0, 3));
3703
3717
### ` buf.asciiWrite(string[, offset[, length]]) `
3704
3718
3705
3719
* ` string ` {string} String to write to ` buf ` .
3706
- * ` offset ` {integer} Number of bytes to skip before starting to write ` string ` . ** Default** : 0.
3707
- * ` length ` {integer} Maximum number of bytes to write. ** Default** : ` buf.length - offset ` .
3720
+ * ` offset ` {integer} Number of bytes to skip before starting to write
3721
+ ` string ` . ** Default** : 0.
3722
+ * ` length ` {integer} Maximum number of bytes to write. ** Default** : `buf.
3723
+ length - offset`.
3708
3724
3709
3725
Writes ` string ` to ` buf ` at ` offset ` according to the ASCII character encoding
3710
3726
and returns the number of bytes written. If ` buf ` did not contain enough space
3711
- to fit the entire string, only part of ` string ` will be written. However,
3727
+ to fit the entire string, only part of ` string ` will be written. However,
3712
3728
partially encoded characters will not be written.
3713
3729
3714
3730
In most cases, ` buf.write ` is preferable, especially if ` encoding ` is variable.
@@ -3733,8 +3749,10 @@ console.log(bytesWritten);
3733
3749
### ` buf.base64Write(string[, offset[, length]]) `
3734
3750
3735
3751
* ` string ` {string} String to write to ` buf ` .
3736
- * ` offset ` {integer} Number of bytes to skip before starting to write ` string ` . ** Default** : 0.
3737
- * ` length ` {integer} Maximum number of bytes to write. ** Default** : ` buf.length - offset ` .
3752
+ * ` offset ` {integer} Number of bytes to skip before starting to write
3753
+ ` string ` . ** Default** : 0.
3754
+ * ` length ` {integer} Maximum number of bytes to write. ** Default** : `buf.
3755
+ length - offset`.
3738
3756
* Returns: {integer} The number of bytes written.
3739
3757
3740
3758
Writes ` string ` to ` buf ` at ` offset ` according to the base64 character encoding
@@ -3797,8 +3815,10 @@ console.log(bytesWritten);
3797
3815
### ` buf.hexWrite(string[, offset[, length]]) `
3798
3816
3799
3817
* ` string ` {string} String to write to ` buf ` .
3800
- * ` offset ` {integer} Number of bytes to skip before starting to write ` string ` . ** Default** : 0.
3801
- * ` length ` {integer} Maximum number of bytes to write. ** Default** : ` buf.length - offset ` .
3818
+ * ` offset ` {integer} Number of bytes to skip before starting to write
3819
+ ` string ` . ** Default** : 0.
3820
+ * ` length ` {integer} Maximum number of bytes to write. ** Default** : `buf.
3821
+ length - offset`.
3802
3822
* Returns: {integer} The number of bytes written.
3803
3823
3804
3824
Writes ` string ` to ` buf ` at ` offset ` according to the hex character encoding
@@ -3829,8 +3849,10 @@ console.log(bytesWritten);
3829
3849
### ` buf.latin1Write(string[, offset[, length]]) `
3830
3850
3831
3851
* ` string ` {string} String to write to ` buf ` .
3832
- * ` offset ` {integer} Number of bytes to skip before starting to write ` string ` . ** Default** : 0.
3833
- * ` length ` {integer} Maximum number of bytes to write. ** Default** : ` buf.length - offset ` .
3852
+ * ` offset ` {integer} Number of bytes to skip before starting to write
3853
+ ` string ` . ** Default** : 0.
3854
+ * ` length ` {integer} Maximum number of bytes to write. ** Default** : `buf.
3855
+ length - offset`.
3834
3856
* Returns: {integer} The number of bytes written.
3835
3857
3836
3858
Writes ` string ` to ` buf ` at ` offset ` according to the latin1 character encoding
@@ -3861,8 +3883,10 @@ console.log(bytesWritten);
3861
3883
### ` buf.utf8Write(string[, offset[, length]]) `
3862
3884
3863
3885
* ` string ` {string} String to write to ` buf ` .
3864
- * ` offset ` {integer} Number of bytes to skip before starting to write ` string ` . ** Default** : 0.
3865
- * ` length ` {integer} Maximum number of bytes to write. ** Default** : ` buf.length - offset ` .
3886
+ * ` offset ` {integer} Number of bytes to skip before starting to write
3887
+ ` string ` . ** Default** : 0.
3888
+ * ` length ` {integer} Maximum number of bytes to write. ** Default** : `buf.
3889
+ length - offset`.
3866
3890
* Returns: {integer} The number of bytes written.
3867
3891
3868
3892
Writes ` string ` to ` buf ` at ` offset ` according to the utf8 character encoding
0 commit comments