(target: Uint8Array, targetStart = 0, sourceStart = 0, sourceEnd = this.length)
| 357 | } |
| 358 | |
| 359 | copy(target: Uint8Array, targetStart = 0, sourceStart = 0, sourceEnd = this.length) { |
| 360 | assertUnsigned(targetStart, 'targetStart') |
| 361 | assertUnsigned(sourceStart, 'sourceStart', this.length) |
| 362 | assertUnsigned(sourceEnd, 'sourceEnd') |
| 363 | |
| 364 | targetStart >>>= 0 |
| 365 | sourceStart >>>= 0 |
| 366 | sourceEnd >>>= 0 |
| 367 | |
| 368 | let copiedBytes = 0 |
| 369 | while (sourceStart < sourceEnd) { |
| 370 | if (this[sourceStart] === undefined) break |
| 371 | if (target[targetStart] === undefined) break |
| 372 | |
| 373 | target[targetStart] = this[sourceStart] |
| 374 | copiedBytes++ |
| 375 | sourceStart++ |
| 376 | targetStart++ |
| 377 | } |
| 378 | |
| 379 | return copiedBytes |
| 380 | } |
| 381 | |
| 382 | write(string: string, encoding?: Encoding): number |
| 383 | write(string: string, offset: number, encoding?: Encoding): number |
no test coverage detected