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