Merge "Fix a compatibility issue: getBigUint64." am: 74232e7a3f
Original change: https://android-review.googlesource.com/c/platform/development/+/1781348 Change-Id: I5299018a9d5d01fc02693d749af9646f54c0da41
This commit is contained in:
@@ -78,6 +78,15 @@ export class Payload {
|
|||||||
readInt(size) {
|
readInt(size) {
|
||||||
let /** DataView */ view = new DataView(
|
let /** DataView */ view = new DataView(
|
||||||
this.buffer.slice(this.cursor, this.cursor + size))
|
this.buffer.slice(this.cursor, this.cursor + size))
|
||||||
|
if (typeof view.getBigUint64 !== "function") {
|
||||||
|
view.getBigUint64 =
|
||||||
|
function(offset) {
|
||||||
|
const a = BigInt(view.getUint32(offset))
|
||||||
|
const b = BigInt(view.getUint32(offset + 4))
|
||||||
|
const bigNumber = a * 4294967296n + b
|
||||||
|
return bigNumber
|
||||||
|
}
|
||||||
|
}
|
||||||
this.cursor += size
|
this.cursor += size
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case 2:
|
case 2:
|
||||||
|
|||||||
Reference in New Issue
Block a user