@@ -250,7 +250,7 @@ export class DynamicBuffer {
250250 length ?: number ,
251251 encoding ?: BufferEncoding ,
252252 ) : number {
253- const count = this . writeData ( data , this . used , length , encoding ) ;
253+ const count = this . writeString ( data , this . used , length , encoding ) ;
254254 this . used += count ;
255255
256256 return count ;
@@ -1661,7 +1661,7 @@ export class DynamicBuffer {
16611661 checkRange ( 'offset' , offset , 0 ) ;
16621662 }
16631663
1664- const count = this . writeData ( data , offset , length , encoding ) ;
1664+ const count = this . writeString ( data , offset , length , encoding ) ;
16651665 this . used = offset + count ;
16661666
16671667 return count ;
@@ -1784,7 +1784,7 @@ export class DynamicBuffer {
17841784 }
17851785
17861786 /**
1787- * Writes data to the specified position in the buffer, and skip if out of used range.
1787+ * Writes a byte to the specified position in the buffer, and skip if out of used range.
17881788 *
17891789 * @param data Data to write to buffer.
17901790 * @param offset The position to write data.
@@ -1801,15 +1801,15 @@ export class DynamicBuffer {
18011801 }
18021802
18031803 /**
1804- * Write data into internal buffer with the specified offset.
1804+ * Write a string into internal buffer with the specified offset.
18051805 *
18061806 * @param data String to write to buffer.
18071807 * @param offset Number of bytes to skip before starting to write data.
18081808 * @param length Maximum number of bytes to write, default the length of string.
18091809 * @param encoding The character encoding to use, default from buffer encoding.
18101810 * @returns Number of bytes written.
18111811 */
1812- private writeData (
1812+ private writeString (
18131813 data : string ,
18141814 offset : number ,
18151815 length ?: number ,
0 commit comments