From 4669766146a1c73281573a787fa80afc359432bd Mon Sep 17 00:00:00 2001 From: Frank Wuerthwein Date: Fri, 6 Feb 2009 23:18:34 +0000 Subject: 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 --- src/lib/binaryXHR.js | 20 ++++++++------------ 1 file 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 -- cgit v1.2.3