()
| 416 | } |
| 417 | |
| 418 | private readBit() { |
| 419 | const byteIndex = Math.floor(this.pos / 8); |
| 420 | const byte = this.bytes[byteIndex] ?? 0; |
| 421 | const bitIndex = 0b111 - (this.pos & 0b111); |
| 422 | const bit = (byte & (1 << bitIndex)) >> bitIndex; |
| 423 | |
| 424 | this.pos++; |
| 425 | return bit; |
| 426 | } |
| 427 | |
| 428 | readBits(n: number) { |
| 429 | if (n === 1) { |