X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2FJU%2FCompoundDocHeader.js;h=f81cf39d1143457820d462dc65647bb894ec0ddb;hp=a45ff3df8410a2b72e2174ae35cc55cc0c02b904;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/JU/CompoundDocHeader.js b/site/j2s/JU/CompoundDocHeader.js index a45ff3d..f81cf39 100644 --- a/site/j2s/JU/CompoundDocHeader.js +++ b/site/j2s/JU/CompoundDocHeader.js @@ -1,66 +1,66 @@ -Clazz.declarePackage ("JU"); -c$ = Clazz.decorateAsClass (function () { -this.cd = null; -this.magicNumbers = null; -this.uniqueID16 = null; -this.revNumber = 0; -this.verNumber = 0; -this.sectorPower = 0; -this.shortSectorPower = 0; -this.unused = null; -this.nSATsectors = 0; -this.SID_DIR_start = 0; -this.minBytesStandardStream = 0; -this.SID_SSAT_start = 0; -this.nSSATsectors = 0; -this.SID_MSAT_next = 0; -this.nAdditionalMATsectors = 0; -this.MSAT0 = null; -Clazz.instantialize (this, arguments); -}, JU, "CompoundDocHeader"); -Clazz.prepareFields (c$, function () { -this.magicNumbers = Clazz.newByteArray (8, 0); -this.uniqueID16 = Clazz.newByteArray (16, 0); -this.unused = Clazz.newByteArray (10, 0); -this.MSAT0 = Clazz.newIntArray (109, 0); -}); -Clazz.makeConstructor (c$, -function (compoundDocument) { -this.cd = compoundDocument; -}, "JU.CompoundDocument"); -Clazz.defineMethod (c$, "readData", -function () { -try { -this.cd.readByteArray (this.magicNumbers, 0, 8); -if (this.magicNumbers[0] != 0xD0 || this.magicNumbers[1] != 0xCF || this.magicNumbers[2] != 0x11 || this.magicNumbers[3] != 0xE0 || this.magicNumbers[4] != 0xA1 || this.magicNumbers[5] != 0xB1 || this.magicNumbers[6] != 0x1A || this.magicNumbers[7] != 0xE1) return false; -this.cd.readByteArray (this.uniqueID16, 0, 16); -this.revNumber = this.cd.readByte (); -this.cd.readByte (); -this.verNumber = this.cd.readByte (); -this.cd.readByte (); -var b1 = this.cd.readByte (); -var b2 = this.cd.readByte (); -this.cd.isBigEndian = (b1 == -1 && b2 == -2); -this.sectorPower = this.cd.readShort (); -this.shortSectorPower = this.cd.readShort (); -this.cd.readByteArray (this.unused, 0, 10); -this.nSATsectors = this.cd.readInt (); -this.SID_DIR_start = this.cd.readInt (); -this.cd.readByteArray (this.unused, 0, 4); -this.minBytesStandardStream = this.cd.readInt (); -this.SID_SSAT_start = this.cd.readInt (); -this.nSSATsectors = this.cd.readInt (); -this.SID_MSAT_next = this.cd.readInt (); -this.nAdditionalMATsectors = this.cd.readInt (); -for (var i = 0; i < 109; i++) this.MSAT0[i] = this.cd.readInt (); - -} catch (e) { -if (Clazz.exceptionOf (e, Exception)) { -System.out.println (e.toString ()); -return false; -} else { -throw e; -} -} -return true; -}); +Clazz.declarePackage ("JU"); +c$ = Clazz.decorateAsClass (function () { +this.cd = null; +this.magicNumbers = null; +this.uniqueID16 = null; +this.revNumber = 0; +this.verNumber = 0; +this.sectorPower = 0; +this.shortSectorPower = 0; +this.unused = null; +this.nSATsectors = 0; +this.SID_DIR_start = 0; +this.minBytesStandardStream = 0; +this.SID_SSAT_start = 0; +this.nSSATsectors = 0; +this.SID_MSAT_next = 0; +this.nAdditionalMATsectors = 0; +this.MSAT0 = null; +Clazz.instantialize (this, arguments); +}, JU, "CompoundDocHeader"); +Clazz.prepareFields (c$, function () { +this.magicNumbers = Clazz.newByteArray (8, 0); +this.uniqueID16 = Clazz.newByteArray (16, 0); +this.unused = Clazz.newByteArray (10, 0); +this.MSAT0 = Clazz.newIntArray (109, 0); +}); +Clazz.makeConstructor (c$, +function (compoundDocument) { +this.cd = compoundDocument; +}, "JU.CompoundDocument"); +Clazz.defineMethod (c$, "readData", +function () { +try { +this.cd.readByteArray (this.magicNumbers, 0, 8); +if (this.magicNumbers[0] != 0xD0 || this.magicNumbers[1] != 0xCF || this.magicNumbers[2] != 0x11 || this.magicNumbers[3] != 0xE0 || this.magicNumbers[4] != 0xA1 || this.magicNumbers[5] != 0xB1 || this.magicNumbers[6] != 0x1A || this.magicNumbers[7] != 0xE1) return false; +this.cd.readByteArray (this.uniqueID16, 0, 16); +this.revNumber = this.cd.readByte (); +this.cd.readByte (); +this.verNumber = this.cd.readByte (); +this.cd.readByte (); +var b1 = this.cd.readByte (); +var b2 = this.cd.readByte (); +this.cd.isBigEndian = (b1 == -1 && b2 == -2); +this.sectorPower = this.cd.readShort (); +this.shortSectorPower = this.cd.readShort (); +this.cd.readByteArray (this.unused, 0, 10); +this.nSATsectors = this.cd.readInt (); +this.SID_DIR_start = this.cd.readInt (); +this.cd.readByteArray (this.unused, 0, 4); +this.minBytesStandardStream = this.cd.readInt (); +this.SID_SSAT_start = this.cd.readInt (); +this.nSSATsectors = this.cd.readInt (); +this.SID_MSAT_next = this.cd.readInt (); +this.nAdditionalMATsectors = this.cd.readInt (); +for (var i = 0; i < 109; i++) this.MSAT0[i] = this.cd.readInt (); + +} catch (e) { +if (Clazz.exceptionOf (e, Exception)) { +System.out.println (e.toString ()); +return false; +} else { +throw e; +} +} +return true; +});