File size: 1,943 Bytes
233f6d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Clazz.declarePackage ("JU");
c$ = Clazz.decorateAsClass (function () {
this.cd = null;
this.unicodeName64 = null;
this.nBytesUnicodeName = 0;
this.entryType = 0;
this.uniqueID16 = null;
this.userflags4 = null;
this.SIDfirstSector = 0;
this.lenStream = 0;
this.unused = null;
this.entryName = null;
this.isStandard = false;
this.isEmpty = false;
Clazz.instantialize (this, arguments);
}, JU, "CompoundDocDirEntry");
Clazz.prepareFields (c$, function () {
this.unicodeName64 =  Clazz.newByteArray (64, 0);
this.uniqueID16 =  Clazz.newByteArray (16, 0);
this.userflags4 =  Clazz.newByteArray (4, 0);
this.unused =  Clazz.newByteArray (8, 0);
});
Clazz.makeConstructor (c$, 
function (compoundDocument) {
this.cd = compoundDocument;
}, "JU.CompoundDocument");
Clazz.defineMethod (c$, "readData", 
function () {
try {
this.cd.readByteArray (this.unicodeName64, 0, 64);
this.nBytesUnicodeName = this.cd.readShort ();
this.entryType = this.cd.readByte ();
this.cd.readByte ();
this.cd.readInt ();
this.cd.readInt ();
this.cd.readInt ();
this.cd.readByteArray (this.uniqueID16, 0, 16);
this.cd.readByteArray (this.userflags4, 0, 4);
this.cd.readByteArray (this.unused, 0, 8);
this.cd.readByteArray (this.unused, 0, 8);
this.SIDfirstSector = this.cd.readInt ();
this.lenStream = this.cd.readInt ();
this.cd.readByteArray (this.unused, 0, 4);
} catch (e) {
if (Clazz.exceptionOf (e, Exception)) {
System.out.println (e.toString ());
return false;
} else {
throw e;
}
}
this.entryName = "";
for (var i = 0; i < this.nBytesUnicodeName - 2; i += 2) this.entryName += String.fromCharCode (this.unicodeName64[i]);

this.isStandard = (this.entryType == 5 || this.lenStream >= this.cd.header.minBytesStandardStream);
this.isEmpty = (this.entryType == 0 || this.lenStream <= 0);
return true;
});
Clazz.overrideMethod (c$, "toString", 
function () {
return this.entryName + " " + this.lenStream;
});