* Read a null-terminated string (ASCII) * Uses array + join pattern to avoid O(n²) string concatenation
()
| 67 | * Uses array + join pattern to avoid O(n²) string concatenation |
| 68 | */ |
| 69 | readString(): string { |
| 70 | const chars: string[] = []; |
| 71 | let char: number; |
| 72 | while ((char = this.readUint8()) !== 0) { |
| 73 | chars.push(String.fromCharCode(char)); |
| 74 | } |
| 75 | return chars.join(''); |
| 76 | } |
| 77 | |
| 78 | skip(bytes: number): void { |
| 79 | this.offset += bytes; |
no test coverage detected