Skip to content

Commit 1408d60

Browse files
committed
byte lengthhh
some chars are more than one byte in size so .length isnt always going to be correct for byte length
1 parent bd8c0c4 commit 1408d60

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/BinaryStream.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,7 @@ class BinaryStream {
623623
* @return {BinaryStream}
624624
*/
625625
writeString(v){
626-
let buf = Buffer.alloc(v.length);
627-
buf.write(v, 0, v.length, "utf8");
628-
this.append(buf);
626+
this.append(Buffer.from(v, "utf8"));
629627
return this;
630628
}
631629

0 commit comments

Comments
 (0)