()
| 47 | } |
| 48 | |
| 49 | public readBit(): number { |
| 50 | // need a new byte? |
| 51 | if (this._position >= 8) { |
| 52 | this._currentByte = this._source.readByte(); |
| 53 | if (this._currentByte === -1) { |
| 54 | throw new EndOfReaderError(); |
| 55 | } |
| 56 | this._position = 0; |
| 57 | } |
| 58 | // shift the desired byte to the least significant bit and |
| 59 | // get the value using masking |
| 60 | const value: number = (this._currentByte >> (BitReader._byteSize - this._position - 1)) & 0x01; |
| 61 | this._position++; |
| 62 | return value; |
| 63 | } |
| 64 | |
| 65 | public readAll(): Uint8Array { |
| 66 | const all: ByteBuffer = ByteBuffer.empty(); |
no test coverage detected