summaryrefslogtreecommitdiff
path: root/spicedataview.js
diff options
context:
space:
mode:
authorAric Stewart <aric@codeweavers.com>2013-09-16 11:11:44 -0500
committerJeremy White <jwhite@codeweavers.com>2013-09-18 09:06:03 -0500
commit295073a95469e1f8633d5f70e6bad8be367b4635 (patch)
tree158f42c06191e8e8733a02da8db953dd9315157d /spicedataview.js
parent3056d62ae2c305362f1437744d14ab18900efc26 (diff)
implement and use a new dataview getUint64
Diffstat (limited to 'spicedataview.js')
-rw-r--r--spicedataview.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/spicedataview.js b/spicedataview.js
index 43f0170..800df03 100644
--- a/spicedataview.js
+++ b/spicedataview.js
@@ -66,6 +66,18 @@ SpiceDataView.prototype = {
return (this.getUint16(byteOffset + high, littleEndian) << 16) |
this.getUint16(byteOffset + low, littleEndian);
},
+ getUint64: function (byteOffset, littleEndian)
+ {
+ var low = 4, high = 0;
+ if (littleEndian)
+ {
+ low = 0;
+ high = 4;
+ }
+
+ return (this.getUint32(byteOffset + high, littleEndian) << 32) |
+ this.getUint32(byteOffset + low, littleEndian);
+ },
setUint8: function(byteOffset, b)
{
this.u8[byteOffset] = (b & 0xff);