MCPcopy
hub / github.com/google/brotli / readBlockLength

Function readBlockLength

js/decode.ts:255–267  ·  view source on GitHub ↗
(tableGroup: Int32Array, tableIdx: number, s: State)

Source from the content-addressed store, hash-verified

253 return tableGroup[offset] & 0xFFFF;
254}
255function readBlockLength(tableGroup: Int32Array, tableIdx: number, s: State): number {
256 if (s.bitOffset >= 16) {
257 s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16);
258 s.bitOffset -= 16;
259 }
260 const code: number = readSymbol(tableGroup, tableIdx, s);
261 const n: number = BLOCK_LENGTH_N_BITS[code];
262 if (s.bitOffset >= 16) {
263 s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16);
264 s.bitOffset -= 16;
265 }
266 return BLOCK_LENGTH_OFFSET[code] + ((n <= 16) ? readFewBits(s, n) : readManyBits(s, n));
267}
268function moveToFront(v: Int32Array, index: number): void {
269 let i: number = index;
270 const value: number = v[i];

Callers 2

decodeBlockTypeAndLengthFunction · 0.70
readMetablockPartitionFunction · 0.70

Calls 3

readSymbolFunction · 0.70
readFewBitsFunction · 0.70
readManyBitsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…