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

Method readVarInt64

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

Source from the content-addressed store, hash-verified

561 }
562
563 readVarInt64() {
564 const v = this.readVarUInt64Value();
565 if (typeof v === "number") {
566 if (v <= 0xffffffff) {
567 return BigInt((v >>> 1) ^ -(v & 1));
568 }
569 return BigInt(v % 2 === 0 ? v / 2 : -(v + 1) / 2);
570 }
571 return (v >> 1n) ^ -(v & 1n); // zigZag decode
572 }
573
574 readFloat16() {
575 return fromFloat16Bits(this.readUint16());

Callers 1

readSliInt64Method · 0.95

Calls 1

readVarUInt64ValueMethod · 0.95

Tested by

no test coverage detected