You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,16 @@ Reads a single character from the buffer according to the specified character en
103
103
Writes a single character to the buffer according to the specified character encoding. Multi-byte characters are not written - use `writeString` for that instead.
104
104
'encoding' defaults to utf8.
105
105
106
+
## .readChars(length, [encoding])
107
+
108
+
Reads a fixed number of characters from the buffer according to the specified character encoding. The resulting string strips any trailing null characters.
109
+
'encoding' defaults to utf8.
110
+
111
+
## .writeChars(str, length, [encoding])
112
+
113
+
Writes a string to the underlying buffer with the specified encoding, padding with null characters (0) if the string is shorter than length.
114
+
'encoding' defaults to utf8.
115
+
106
116
## .readString([length, [encoding]])
107
117
108
118
Decodes to a string according to the specified character encoding in encoding and length.
@@ -120,7 +130,7 @@ Functions the same way as .readString(), but does not update the offset.
120
130
121
131
## .readString0([encoding])
122
132
123
-
Reads a string from the buffer according to the specified character encoding, stopping at the first zero (0) byte. Similar to calling .readString() without a length parameter, but more implicit.
133
+
Reads a string from the buffer according to the specified character encoding, stopping at the first zero (0) byte. Similar to `.readString()` or `.readString(undefined, encoding)`, but more implicit.
0 commit comments