()
| 73 | } |
| 74 | |
| 75 | readCString(): string { |
| 76 | const start = this.#offset; |
| 77 | // find next null byte |
| 78 | const end = this.#buffer.indexOf(0, start); |
| 79 | const slice = this.#buffer.slice(start, end); |
| 80 | // add +1 for null byte |
| 81 | this.#offset = end + 1; |
| 82 | return this.#decoder.decode(slice); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | export class PacketWriter { |
no outgoing calls
no test coverage detected