()
| 397 | } |
| 398 | |
| 399 | readVarUint36Small(): number { |
| 400 | const readIdx = this.cursor; |
| 401 | if (this.byteLength - readIdx > 0) { |
| 402 | const value = this.dataView.getUint8(readIdx); |
| 403 | if ((value & 0x80) === 0) { |
| 404 | this.cursor = readIdx + 1; |
| 405 | return value; |
| 406 | } |
| 407 | } |
| 408 | if (this.byteLength - readIdx >= 5) { |
| 409 | const fourByteValue = this.dataView.getUint32(readIdx, true); |
| 410 | this.cursor = readIdx + 1; |
| 411 | let result = fourByteValue & 0x7f; |
| 412 | if ((fourByteValue & 0x80) !== 0) { |
| 413 | this.cursor++; |
| 414 | result |= (fourByteValue >>> 1) & 0x3f80; |
| 415 | if ((fourByteValue & 0x8000) !== 0) { |
| 416 | return this.continueReadVarUint36(readIdx + 2, fourByteValue, result); |
| 417 | } |
| 418 | } |
| 419 | return result; |
| 420 | } else { |
| 421 | return this.readVarUint36Slow(); |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | private continueReadVarUint36( |
| 426 | readIdx: number, |
no test coverage detected