MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / readBit

Method readBit

packages/alphatab/src/io/BitReader.ts:49–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 2

readBitsMethod · 0.95
readBitsReversedMethod · 0.95

Calls 1

readByteMethod · 0.65

Tested by

no test coverage detected