MCPcopy Create free account
hub / github.com/Tencent/libpag / readEncodedUint64

Method readEncodedUint64

web/lite/src/codec/utils/byte-array.ts:197–215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195 }
196
197 public readEncodedUint64(): number {
198 const valueMask = 127;
199 const hasNext = 128;
200 let value = 0;
201 let byte = 0;
202 for (let i = 0; i < 64; i += 7) {
203 if (this._position >= this.length) {
204 throw Error('readEncodedUint64 End of file was encountered.');
205 }
206 byte = this.dataView.getUint8(this._position);
207 this._position += 1;
208 value |= (byte & valueMask) << i;
209 if ((byte & hasNext) === 0) {
210 break;
211 }
212 }
213 this.positonChanged();
214 return value;
215 }
216
217 public readEncodeInt64(): number {
218 const data = this.readEncodedUint64();

Callers 2

readEncodeInt64Method · 0.95
readTimeFunction · 0.45

Calls 1

positonChangedMethod · 0.95

Tested by

no test coverage detected