MCPcopy Create free account
hub / github.com/apache/fory / readVarUint32Small14

Method readVarUint32Small14

javascript/packages/core/lib/reader/index.ts:362–379  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

360 }
361
362 private readVarUint32Small14(): number {
363 const readIdx = this.cursor;
364 if (this.byteLength - readIdx >= 5) {
365 const fourByteValue = this.dataView.getUint32(readIdx, true);
366 this.cursor = readIdx + 1;
367 let value = fourByteValue & 0x7f;
368 if ((fourByteValue & 0x80) !== 0) {
369 this.cursor++;
370 value |= (fourByteValue >>> 1) & 0x3f80;
371 if ((fourByteValue & 0x8000) !== 0) {
372 return this.continueReadVarUint32(readIdx + 2, fourByteValue, value);
373 }
374 }
375 return value;
376 } else {
377 return this.readVarUint36Slow();
378 }
379 }
380
381 private continueReadVarUint32(
382 readIdx: number,

Callers 1

readVarUint32Small7Method · 0.95

Calls 2

continueReadVarUint32Method · 0.95
readVarUint36SlowMethod · 0.95

Tested by

no test coverage detected