1 Clazz.declarePackage ("JU");
2 Clazz.load (null, "JU.GZIPHeader", ["JU.ZStream", "java.lang.IllegalArgumentException", "$.InternalError"], function () {
3 c$ = Clazz.decorateAsClass (function () {
16 Clazz.instantialize (this, arguments);
17 }, JU, "GZIPHeader", null, Cloneable);
18 Clazz.defineMethod (c$, "setModifiedTime",
22 Clazz.defineMethod (c$, "getModifiedTime",
26 Clazz.defineMethod (c$, "setOS",
28 if ((0 <= os && os <= 13) || os == 255) this.os = os;
29 else throw new IllegalArgumentException ("os: " + os);
31 Clazz.defineMethod (c$, "getOS",
35 Clazz.defineMethod (c$, "setName",
37 this.name = JU.ZStream.getBytes (name);
39 Clazz.defineMethod (c$, "getName",
41 if (this.name == null) return "";
43 return String.instantialize (this.name, "ISO-8859-1");
45 if (Clazz.exceptionOf (e, java.io.UnsupportedEncodingException)) {
46 throw new InternalError (e.toString ());
52 Clazz.defineMethod (c$, "setComment",
54 this.comment = JU.ZStream.getBytes (comment);
56 Clazz.defineMethod (c$, "getComment",
58 if (this.comment == null) return "";
60 return String.instantialize (this.comment, "ISO-8859-1");
62 if (Clazz.exceptionOf (e, java.io.UnsupportedEncodingException)) {
63 throw new InternalError (e.toString ());
69 Clazz.defineMethod (c$, "setCRC",
73 Clazz.defineMethod (c$, "getCRC",
77 Clazz.defineMethod (c$, "put",
84 }if (this.extra != null) {
86 }if (this.name != null) {
88 }if (this.comment != null) {
93 } else if (d.level == 9) {
95 }d.put_short (0x8b1f);
98 d.put_byteB (this.mtime);
99 d.put_byteB ((this.mtime >> 8));
100 d.put_byteB ((this.mtime >> 16));
101 d.put_byteB ((this.mtime >> 24));
103 d.put_byteB (this.os);
104 if (this.extra != null) {
105 d.put_byteB (this.extra.length);
106 d.put_byteB ((this.extra.length >> 8));
107 d.put_byte (this.extra, 0, this.extra.length);
108 }if (this.name != null) {
109 d.put_byte (this.name, 0, this.name.length);
111 }if (this.comment != null) {
112 d.put_byte (this.comment, 0, this.comment.length);
115 Clazz.defineMethod (c$, "clone",
117 var gheader = Clazz.superCall (this, JU.GZIPHeader, "clone", []);
119 if (gheader.extra != null) {
120 tmp = Clazz.newByteArray (gheader.extra.length, 0);
121 System.arraycopy (gheader.extra, 0, tmp, 0, tmp.length);
123 }if (gheader.name != null) {
124 tmp = Clazz.newByteArray (gheader.name.length, 0);
125 System.arraycopy (gheader.name, 0, tmp, 0, tmp.length);
127 }if (gheader.comment != null) {
128 tmp = Clazz.newByteArray (gheader.comment.length, 0);
129 System.arraycopy (gheader.comment, 0, tmp, 0, tmp.length);
130 gheader.comment = tmp;
133 Clazz.defineStatics (c$,