File tree Expand file tree Collapse file tree 1 file changed +9
-21
lines changed
Expand file tree Collapse file tree 1 file changed +9
-21
lines changed Original file line number Diff line number Diff line change @@ -449,27 +449,6 @@ class BinaryStream {
449449 return this ;
450450 }
451451
452- /*readString(returnBuffer = false){
453- let buffer = this.read(this.readUnsignedVarInt());
454- return returnBuffer === true ? buffer : buffer.toString();
455- }
456-
457- /**
458- * @param v {string}
459- * @return {BinaryStream }
460- *
461- writeString(v){
462- this.writeUnsignedVarInt(v.length);
463-
464- if(v.length === 0) return this;
465-
466- let buf = Buffer.alloc(v.length);
467- buf.write(v);
468-
469- this.append(buf);
470- return this;
471- }*/
472-
473452 /**
474453 * @return {number }
475454 */
@@ -627,6 +606,15 @@ class BinaryStream {
627606 return this ;
628607 }
629608
609+ /**
610+ * @param v {string}
611+ * @return {BinaryStream }
612+ */
613+ writeString ( v ) {
614+ this . append ( Buffer . from ( v ) ) ;
615+ return this ;
616+ }
617+
630618 flip ( ) {
631619 this . offset = 0 ;
632620 return this ;
You can’t perform that action at this time.
0 commit comments