@@ -497,7 +497,6 @@ console.log(buf1.toString());
497
497
// Prints: this is a tC)st
498
498
console .log (buf1 .toString (' ascii' ));
499
499
500
-
501
500
const buf2 = new Buffer (' 7468697320697320612074c3a97374' , ' hex' );
502
501
503
502
// Prints: this is a tést
@@ -906,7 +905,6 @@ console.log(buf1.toString());
906
905
// Prints: this is a tC)st
907
906
console .log (buf1 .toString (' ascii' ));
908
907
909
-
910
908
const buf2 = Buffer .from (' 7468697320697320612074c3a97374' , ' hex' );
911
909
912
910
// Prints: this is a tést
@@ -1366,7 +1364,6 @@ console.log(buf.indexOf(Buffer.from('a buffer example')));
1366
1364
// Prints: 8
1367
1365
console .log (buf .indexOf (Buffer .from (' a buffer example' ).slice (0 , 8 )));
1368
1366
1369
-
1370
1367
const utf16Buffer = Buffer .from (' \u039a\u0391\u03a3\u03a3\u0395 ' , ' ucs2' );
1371
1368
1372
1369
// Prints: 4
@@ -1477,7 +1474,6 @@ console.log(buf.lastIndexOf('buffer', 5));
1477
1474
// Prints: -1
1478
1475
console .log (buf .lastIndexOf (' buffer' , 4 ));
1479
1476
1480
-
1481
1477
const utf16Buffer = Buffer .from (' \u039a\u0391\u03a3\u03a3\u0395 ' , ' ucs2' );
1482
1478
1483
1479
// Prints: 6
@@ -2000,7 +1996,6 @@ buf1.swap16();
2000
1996
// Prints: <Buffer 02 01 04 03 06 05 08 07>
2001
1997
console .log (buf1);
2002
1998
2003
-
2004
1999
const buf2 = Buffer .from ([0x1 , 0x2 , 0x3 ]);
2005
2000
2006
2001
// Throws an exception: RangeError: Buffer size must be a multiple of 16-bits
@@ -2030,7 +2025,6 @@ buf1.swap32();
2030
2025
// Prints: <Buffer 04 03 02 01 08 07 06 05>
2031
2026
console .log (buf1);
2032
2027
2033
-
2034
2028
const buf2 = Buffer .from ([0x1 , 0x2 , 0x3 ]);
2035
2029
2036
2030
// Throws an exception: RangeError: Buffer size must be a multiple of 32-bits
@@ -2060,7 +2054,6 @@ buf1.swap64();
2060
2054
// Prints: <Buffer 08 07 06 05 04 03 02 01>
2061
2055
console .log (buf1);
2062
2056
2063
-
2064
2057
const buf2 = Buffer .from ([0x1 , 0x2 , 0x3 ]);
2065
2058
2066
2059
// Throws an exception: RangeError: Buffer size must be a multiple of 64-bits
@@ -2132,7 +2125,6 @@ console.log(buf1.toString('ascii'));
2132
2125
// Prints: abcde
2133
2126
console .log (buf1 .toString (' ascii' , 0 , 5 ));
2134
2127
2135
-
2136
2128
const buf2 = Buffer .from (' tést' );
2137
2129
2138
2130
// Prints: 74c3a97374
0 commit comments