(n: number)
| 426 | } |
| 427 | |
| 428 | readBits(n: number) { |
| 429 | if (n === 1) { |
| 430 | return this.readBit(); |
| 431 | } |
| 432 | |
| 433 | let result = 0; |
| 434 | |
| 435 | for (let i = 0; i < n; i++) { |
| 436 | result <<= 1; |
| 437 | result |= this.readBit(); |
| 438 | } |
| 439 | |
| 440 | return result; |
| 441 | } |
| 442 | |
| 443 | writeBits(n: number, value: number) { |
| 444 | const end = this.pos + n; |
no test coverage detected