(text, offset = 0, length, encoding)
| 191 | } |
| 192 | |
| 193 | write(text, offset = 0, length, encoding) { |
| 194 | if (typeof length === "string") { |
| 195 | encoding = length; |
| 196 | length = undefined; |
| 197 | } |
| 198 | const bytes = encode(text, encoding); |
| 199 | const count = Math.min(length ?? bytes.length, this.length - offset); |
| 200 | this.set(bytes.subarray(0, count), offset); |
| 201 | return count; |
| 202 | } |
| 203 | |
| 204 | slice(start, end) { |
| 205 | return wrap(this.subarray(start, end)); |