summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Wuerthwein <fkw@ucsd.edu>2009-02-06 23:18:34 +0000
committerFrank Wuerthwein <fkw@ucsd.edu>2009-02-06 23:18:34 +0000
commit4669766146a1c73281573a787fa80afc359432bd (patch)
treee21651bc0b63237f6ade4fd9cf8e408e51733f74
parentdd018257e73d9e5c57938b1e15c7ccc0f2fff4b8 (diff)
Big/little endian was only half supported, and since it is currently not used in other parts of the package, it has been completely removed
-rw-r--r--src/lib/binaryXHR.js20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/lib/binaryXHR.js b/src/lib/binaryXHR.js
index 14d06fe..4c0cc54 100644
--- a/src/lib/binaryXHR.js
+++ b/src/lib/binaryXHR.js
@@ -69,34 +69,30 @@ function BinaryFile(strData, iDataOffset, iDataLength) {
return iByte;
}
- this.getShortAt = function(iOffset, bBigEndian) {
- var iShort = bBigEndian ?
- (this.getByteAt(iOffset) << 8) + this.getByteAt(iOffset + 1)
- : (this.getByteAt(iOffset + 1) << 8) + this.getByteAt(iOffset)
+ this.getShortAt = function(iOffset) {
+ var iShort = (this.getByteAt(iOffset + 1) << 8) + this.getByteAt(iOffset)
if (iShort < 0) iShort += 65536;
return iShort;
}
- this.getSShortAt = function(iOffset, bBigEndian) {
- var iUShort = this.getShortAt(iOffset, bBigEndian);
+ this.getSShortAt = function(iOffset) {
+ var iUShort = this.getShortAt(iOffset);
if (iUShort > 32767)
return iUShort - 65536;
else
return iUShort;
}
- this.getLongAt = function(iOffset, bBigEndian) {
+ this.getLongAt = function(iOffset) {
var iByte1 = this.getByteAt(iOffset),
iByte2 = this.getByteAt(iOffset + 1),
iByte3 = this.getByteAt(iOffset + 2),
iByte4 = this.getByteAt(iOffset + 3);
- var iLong = bBigEndian ?
- (((((iByte1 << 8) + iByte2) << 8) + iByte3) << 8) + iByte4
- : (((((iByte4 << 8) + iByte3) << 8) + iByte2) << 8) + iByte1;
+ var iLong = (((((iByte4 << 8) + iByte3) << 8) + iByte2) << 8) + iByte1;
if (iLong < 0) iLong += 4294967296;
return iLong;
}
- this.getSLongAt = function(iOffset, bBigEndian) {
- var iULong = this.getLongAt(iOffset, bBigEndian);
+ this.getSLongAt = function(iOffset) {
+ var iULong = this.getLongAt(iOffset);
if (iULong > 2147483647)
return iULong - 4294967296;
else