if (offset >= buffer.length) return;
- return buffer[buffer.offset + offset];
+ return buffer[offset];
};
function readUInt16(buffer, offset, isBigEndian, noAssert) {
if (offset >= buffer.length) return 0;
if (isBigEndian) {
- val = buffer[buffer.offset + offset] << 8;
+ val = buffer[offset] << 8;
if (offset + 1 < buffer.length) {
- val |= buffer[buffer.offset + offset + 1];
+ val |= buffer[offset + 1];
}
} else {
- val = buffer[buffer.offset + offset];
+ val = buffer[offset];
if (offset + 1 < buffer.length) {
- val |= buffer[buffer.offset + offset + 1] << 8;
+ val |= buffer[offset + 1] << 8;
}
}
if (isBigEndian) {
if (offset + 1 < buffer.length)
- val = buffer[buffer.offset + offset + 1] << 16;
+ val = buffer[offset + 1] << 16;
if (offset + 2 < buffer.length)
- val |= buffer[buffer.offset + offset + 2] << 8;
+ val |= buffer[offset + 2] << 8;
if (offset + 3 < buffer.length)
- val |= buffer[buffer.offset + offset + 3];
- val = val + (buffer[buffer.offset + offset] << 24 >>> 0);
+ val |= buffer[offset + 3];
+ val = val + (buffer[offset] << 24 >>> 0);
} else {
if (offset + 2 < buffer.length)
- val = buffer[buffer.offset + offset + 2] << 16;
+ val = buffer[offset + 2] << 16;
if (offset + 1 < buffer.length)
- val |= buffer[buffer.offset + offset + 1] << 8;
- val |= buffer[buffer.offset + offset];
+ val |= buffer[offset + 1] << 8;
+ val |= buffer[offset];
if (offset + 3 < buffer.length)
- val = val + (buffer[buffer.offset + offset + 3] << 24 >>> 0);
+ val = val + (buffer[offset + 3] << 24 >>> 0);
}
return val;
if (offset >= buffer.length) return;
- neg = buffer[buffer.offset + offset] & 0x80;
+ neg = buffer[offset] & 0x80;
if (!neg) {
- return (buffer[buffer.offset + offset]);
+ return (buffer[offset]);
}
- return ((0xff - buffer[buffer.offset + offset] + 1) * -1);
+ return ((0xff - buffer[offset] + 1) * -1);
};
function readInt16(buffer, offset, isBigEndian, noAssert) {
}
if (offset < buffer.length) {
- buffer[buffer.offset + offset] = value;
+ buffer[offset] = value;
}
};
}
for (var i = 0; i < Math.min(buffer.length - offset, 2); i++) {
- buffer[buffer.offset + offset + i] =
+ buffer[offset + i] =
(value & (0xff << (8 * (isBigEndian ? 1 - i : i)))) >>>
(isBigEndian ? 1 - i : i) * 8;
}
}
for (var i = 0; i < Math.min(buffer.length - offset, 4); i++) {
- buffer[buffer.offset + offset + i] =
+ buffer[offset + i] =
(value >>> (isBigEndian ? 3 - i : i) * 8) & 0xff;
}
}