Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / JU / Inflate.js
index 03d3d88..dcd7cd2 100644 (file)
-Clazz.declarePackage ("JU");\r
-Clazz.load (["java.lang.Exception"], "JU.Inflate", ["JU.Adler32", "$.CRC32", "$.GZIPHeader", "$.InfBlocks", "java.io.ByteArrayOutputStream"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.mode = 0;\r
-this.method = 0;\r
-this.was = -1;\r
-this.need = 0;\r
-this.marker = 0;\r
-this.wrap = 0;\r
-this.wbits = 0;\r
-this.blocks = null;\r
-this.z = null;\r
-this.flags = 0;\r
-this.need_bytes = -1;\r
-this.crcbuf = null;\r
-this.gheader = null;\r
-if (!Clazz.isClassDefined ("JU.Inflate.Return")) {\r
-JU.Inflate.$Inflate$Return$ ();\r
-}\r
-this.tmp_string = null;\r
-Clazz.instantialize (this, arguments);\r
-}, JU, "Inflate");\r
-Clazz.prepareFields (c$, function () {\r
-this.crcbuf =  Clazz.newByteArray (4, 0);\r
-});\r
-Clazz.defineMethod (c$, "reset", \r
-function () {\r
-this.inflateReset ();\r
-});\r
-Clazz.defineMethod (c$, "inflateReset", \r
-function () {\r
-if (this.z == null) return -2;\r
-this.z.total_in = this.z.total_out = 0;\r
-this.z.msg = null;\r
-this.mode = 14;\r
-this.need_bytes = -1;\r
-this.blocks.reset ();\r
-return 0;\r
-});\r
-Clazz.defineMethod (c$, "inflateEnd", \r
-function () {\r
-if (this.blocks != null) {\r
-this.blocks.free ();\r
-}return 0;\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (z) {\r
-this.z = z;\r
-}, "JU.ZStream");\r
-Clazz.defineMethod (c$, "inflateInit", \r
-function (w) {\r
-this.z.msg = null;\r
-this.blocks = null;\r
-this.wrap = 0;\r
-if (w < 0) {\r
-w = -w;\r
-} else {\r
-this.wrap = (w >> 4) + 1;\r
-if (w < 48) w &= 15;\r
-}if (w < 8 || w > 15) {\r
-this.inflateEnd ();\r
-return -2;\r
-}if (this.blocks != null && this.wbits != w) {\r
-this.blocks.free ();\r
-this.blocks = null;\r
-}this.wbits = w;\r
-this.blocks =  new JU.InfBlocks (this.z, 1 << w);\r
-this.inflateReset ();\r
-return 0;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "inflate", \r
-function (f) {\r
-var r;\r
-var b;\r
-if (this.z == null || this.z.next_in == null) {\r
-if (f == 4 && this.mode == 14) return 0;\r
-return -2;\r
-}f = f == 4 ? -5 : 0;\r
-r = -5;\r
-while (true) {\r
-switch (this.mode) {\r
-case 14:\r
-if (this.wrap == 0) {\r
-this.mode = 7;\r
-break;\r
-}try {\r
-r = this.readBytes (2, r, f);\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, JU.Inflate.Return)) {\r
-return e.r;\r
-} else {\r
-throw e;\r
-}\r
-}\r
-if ((this.wrap & 2) != 0 && this.need == 0x8b1f) {\r
-this.z.checksum =  new JU.CRC32 ();\r
-this.checksum (2, this.need);\r
-if (this.gheader == null) this.gheader =  new JU.GZIPHeader ();\r
-this.mode = 23;\r
-break;\r
-}this.flags = 0;\r
-this.method = (this.need) & 0xff;\r
-b = ((this.need >> 8)) & 0xff;\r
-if ((this.wrap & 1) == 0 || (((this.method << 8) + b) % 31) != 0) {\r
-this.mode = 13;\r
-this.z.msg = "incorrect header check";\r
-break;\r
-}if ((this.method & 0xf) != 8) {\r
-this.mode = 13;\r
-this.z.msg = "unknown compression method";\r
-break;\r
-}if ((this.method >> 4) + 8 > this.wbits) {\r
-this.mode = 13;\r
-this.z.msg = "invalid window size";\r
-break;\r
-}this.z.checksum =  new JU.Adler32 ();\r
-if ((b & 32) == 0) {\r
-this.mode = 7;\r
-break;\r
-}this.mode = 2;\r
-case 2:\r
-if (this.z.avail_in == 0) return r;\r
-r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-this.need = ((this.z.next_in[this.z.next_in_index++] & 0xff) << 24) & 0xff000000;\r
-this.mode = 3;\r
-case 3:\r
-if (this.z.avail_in == 0) return r;\r
-r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 16) & 0xff0000;\r
-this.mode = 4;\r
-case 4:\r
-if (this.z.avail_in == 0) return r;\r
-r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 8) & 0xff00;\r
-this.mode = 5;\r
-case 5:\r
-if (this.z.avail_in == 0) return r;\r
-r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-this.need += (this.z.next_in[this.z.next_in_index++] & 0xff);\r
-this.z.checksum.resetLong (this.need);\r
-this.mode = 6;\r
-return 2;\r
-case 6:\r
-this.mode = 13;\r
-this.z.msg = "need dictionary";\r
-this.marker = 0;\r
-return -2;\r
-case 7:\r
-r = this.blocks.proc (r);\r
-if (r == -3) {\r
-this.mode = 13;\r
-this.marker = 0;\r
-break;\r
-}if (r == 0) {\r
-r = f;\r
-}if (r != 1) {\r
-return r;\r
-}r = f;\r
-this.was = this.z.checksum.getValue ();\r
-this.blocks.reset ();\r
-if (this.wrap == 0) {\r
-this.mode = 12;\r
-break;\r
-}this.mode = 8;\r
-case 8:\r
-if (this.z.avail_in == 0) return r;\r
-r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-this.need = ((this.z.next_in[this.z.next_in_index++] & 0xff) << 24) & 0xff000000;\r
-this.mode = 9;\r
-case 9:\r
-if (this.z.avail_in == 0) return r;\r
-r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 16) & 0xff0000;\r
-this.mode = 10;\r
-case 10:\r
-if (this.z.avail_in == 0) return r;\r
-r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 8) & 0xff00;\r
-this.mode = 11;\r
-case 11:\r
-if (this.z.avail_in == 0) return r;\r
-r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-this.need += (this.z.next_in[this.z.next_in_index++] & 0xff);\r
-if (this.flags != 0) {\r
-this.need = ((this.need & 0xff000000) >> 24 | (this.need & 0x00ff0000) >> 8 | (this.need & 0x0000ff00) << 8 | (this.need & 0x0000ffff) << 24) & 0xffffffff;\r
-}if (((this.was)) != ((this.need))) {\r
-this.z.msg = "incorrect data check";\r
-} else if (this.flags != 0 && this.gheader != null) {\r
-this.gheader.crc = this.need;\r
-}this.mode = 15;\r
-case 15:\r
-if (this.wrap != 0 && this.flags != 0) {\r
-try {\r
-r = this.readBytes (4, r, f);\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, JU.Inflate.Return)) {\r
-return e.r;\r
-} else {\r
-throw e;\r
-}\r
-}\r
-if (this.z.msg != null && this.z.msg.equals ("incorrect data check")) {\r
-this.mode = 13;\r
-this.marker = 5;\r
-break;\r
-}if (this.need != (this.z.total_out & 0xffffffff)) {\r
-this.z.msg = "incorrect length check";\r
-this.mode = 13;\r
-break;\r
-}this.z.msg = null;\r
-} else {\r
-if (this.z.msg != null && this.z.msg.equals ("incorrect data check")) {\r
-this.mode = 13;\r
-this.marker = 5;\r
-break;\r
-}}this.mode = 12;\r
-case 12:\r
-return 1;\r
-case 13:\r
-return -3;\r
-case 23:\r
-try {\r
-r = this.readBytes (2, r, f);\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, JU.Inflate.Return)) {\r
-return e.r;\r
-} else {\r
-throw e;\r
-}\r
-}\r
-this.flags = (this.need) & 0xffff;\r
-if ((this.flags & 0xff) != 8) {\r
-this.z.msg = "unknown compression method";\r
-this.mode = 13;\r
-break;\r
-}if ((this.flags & 0xe000) != 0) {\r
-this.z.msg = "unknown header flags set";\r
-this.mode = 13;\r
-break;\r
-}if ((this.flags & 0x0200) != 0) {\r
-this.checksum (2, this.need);\r
-}this.mode = 16;\r
-case 16:\r
-try {\r
-r = this.readBytes (4, r, f);\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, JU.Inflate.Return)) {\r
-return e.r;\r
-} else {\r
-throw e;\r
-}\r
-}\r
-if (this.gheader != null) this.gheader.time = this.need;\r
-if ((this.flags & 0x0200) != 0) {\r
-this.checksum (4, this.need);\r
-}this.mode = 17;\r
-case 17:\r
-try {\r
-r = this.readBytes (2, r, f);\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, JU.Inflate.Return)) {\r
-return e.r;\r
-} else {\r
-throw e;\r
-}\r
-}\r
-if (this.gheader != null) {\r
-this.gheader.xflags = (this.need) & 0xff;\r
-this.gheader.os = ((this.need) >> 8) & 0xff;\r
-}if ((this.flags & 0x0200) != 0) {\r
-this.checksum (2, this.need);\r
-}this.mode = 18;\r
-case 18:\r
-if ((this.flags & 0x0400) != 0) {\r
-try {\r
-r = this.readBytes (2, r, f);\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, JU.Inflate.Return)) {\r
-return e.r;\r
-} else {\r
-throw e;\r
-}\r
-}\r
-if (this.gheader != null) {\r
-this.gheader.extra =  Clazz.newByteArray ((this.need) & 0xffff, 0);\r
-}if ((this.flags & 0x0200) != 0) {\r
-this.checksum (2, this.need);\r
-}} else if (this.gheader != null) {\r
-this.gheader.extra = null;\r
-}this.mode = 19;\r
-case 19:\r
-if ((this.flags & 0x0400) != 0) {\r
-try {\r
-r = this.readBytes (r, f);\r
-if (this.gheader != null) {\r
-var foo = this.tmp_string.toByteArray ();\r
-this.tmp_string = null;\r
-if (foo.length == this.gheader.extra.length) {\r
-System.arraycopy (foo, 0, this.gheader.extra, 0, foo.length);\r
-} else {\r
-this.z.msg = "bad extra field length";\r
-this.mode = 13;\r
-break;\r
-}}} catch (e) {\r
-if (Clazz.exceptionOf (e, JU.Inflate.Return)) {\r
-return e.r;\r
-} else {\r
-throw e;\r
-}\r
-}\r
-} else if (this.gheader != null) {\r
-this.gheader.extra = null;\r
-}this.mode = 20;\r
-case 20:\r
-if ((this.flags & 0x0800) != 0) {\r
-try {\r
-r = this.readString (r, f);\r
-if (this.gheader != null) {\r
-this.gheader.name = this.tmp_string.toByteArray ();\r
-}this.tmp_string = null;\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, JU.Inflate.Return)) {\r
-return e.r;\r
-} else {\r
-throw e;\r
-}\r
-}\r
-} else if (this.gheader != null) {\r
-this.gheader.name = null;\r
-}this.mode = 21;\r
-case 21:\r
-if ((this.flags & 0x1000) != 0) {\r
-try {\r
-r = this.readString (r, f);\r
-if (this.gheader != null) {\r
-this.gheader.comment = this.tmp_string.toByteArray ();\r
-}this.tmp_string = null;\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, JU.Inflate.Return)) {\r
-return e.r;\r
-} else {\r
-throw e;\r
-}\r
-}\r
-} else if (this.gheader != null) {\r
-this.gheader.comment = null;\r
-}this.mode = 22;\r
-case 22:\r
-if ((this.flags & 0x0200) != 0) {\r
-try {\r
-r = this.readBytes (2, r, f);\r
-} catch (e) {\r
-if (Clazz.exceptionOf (e, JU.Inflate.Return)) {\r
-return e.r;\r
-} else {\r
-throw e;\r
-}\r
-}\r
-if (this.gheader != null) {\r
-this.gheader.hcrc = (this.need & 0xffff);\r
-}if (this.need != (this.z.checksum.getValue () & 0xffff)) {\r
-this.mode = 13;\r
-this.z.msg = "header crc mismatch";\r
-this.marker = 5;\r
-break;\r
-}}this.z.checksum =  new JU.CRC32 ();\r
-this.mode = 7;\r
-break;\r
-default:\r
-return -2;\r
-}\r
-}\r
-}, "~N");\r
-Clazz.defineMethod (c$, "inflateSetDictionary", \r
-function (dictionary, dictLength) {\r
-if (this.z == null || (this.mode != 6 && this.wrap != 0)) {\r
-return -2;\r
-}var index = 0;\r
-var length = dictLength;\r
-if (this.mode == 6) {\r
-var adler_need = this.z.checksum.getValue ();\r
-this.z.checksum.reset ();\r
-this.z.checksum.update (dictionary, 0, dictLength);\r
-if (this.z.checksum.getValue () != adler_need) {\r
-return -3;\r
-}}this.z.checksum.reset ();\r
-if (length >= (1 << this.wbits)) {\r
-length = (1 << this.wbits) - 1;\r
-index = dictLength - length;\r
-}this.blocks.set_dictionary (dictionary, index, length);\r
-this.mode = 7;\r
-return 0;\r
-}, "~A,~N");\r
-Clazz.defineMethod (c$, "inflateSync", \r
-function () {\r
-var n;\r
-var p;\r
-var m;\r
-var r;\r
-var w;\r
-if (this.z == null) return -2;\r
-if (this.mode != 13) {\r
-this.mode = 13;\r
-this.marker = 0;\r
-}if ((n = this.z.avail_in) == 0) return -5;\r
-p = this.z.next_in_index;\r
-m = this.marker;\r
-while (n != 0 && m < 4) {\r
-if (this.z.next_in[p] == JU.Inflate.mark[m]) {\r
-m++;\r
-} else if (this.z.next_in[p] != 0) {\r
-m = 0;\r
-} else {\r
-m = 4 - m;\r
-}p++;\r
-n--;\r
-}\r
-this.z.total_in += p - this.z.next_in_index;\r
-this.z.next_in_index = p;\r
-this.z.avail_in = n;\r
-this.marker = m;\r
-if (m != 4) {\r
-return -3;\r
-}r = this.z.total_in;\r
-w = this.z.total_out;\r
-this.inflateReset ();\r
-this.z.total_in = r;\r
-this.z.total_out = w;\r
-this.mode = 7;\r
-return 0;\r
-});\r
-Clazz.defineMethod (c$, "inflateSyncPoint", \r
-function () {\r
-if (this.z == null || this.blocks == null) return -2;\r
-return this.blocks.sync_point ();\r
-});\r
-Clazz.defineMethod (c$, "readBytes", \r
- function (n, r, f) {\r
-if (this.need_bytes == -1) {\r
-this.need_bytes = n;\r
-this.need = 0;\r
-}while (this.need_bytes > 0) {\r
-if (this.z.avail_in == 0) {\r
-throw Clazz.innerTypeInstance (JU.Inflate.Return, this, null, r);\r
-}r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-this.need = this.need | ((this.z.next_in[this.z.next_in_index++] & 0xff) << ((n - this.need_bytes) * 8));\r
-this.need_bytes--;\r
-}\r
-if (n == 2) {\r
-this.need &= 0xffff;\r
-} else if (n == 4) {\r
-this.need &= 0xffffffff;\r
-}this.need_bytes = -1;\r
-return r;\r
-}, "~N,~N,~N");\r
-Clazz.defineMethod (c$, "readString", \r
- function (r, f) {\r
-if (this.tmp_string == null) {\r
-this.tmp_string =  new java.io.ByteArrayOutputStream ();\r
-}var b = 0;\r
-do {\r
-if (this.z.avail_in == 0) {\r
-throw Clazz.innerTypeInstance (JU.Inflate.Return, this, null, r);\r
-}r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-b = this.z.next_in[this.z.next_in_index];\r
-if (b != 0) this.tmp_string.write (this.z.next_in, this.z.next_in_index, 1);\r
-this.z.checksum.update (this.z.next_in, this.z.next_in_index, 1);\r
-this.z.next_in_index++;\r
-} while (b != 0);\r
-return r;\r
-}, "~N,~N");\r
-Clazz.defineMethod (c$, "readBytes", \r
- function (r, f) {\r
-if (this.tmp_string == null) {\r
-this.tmp_string =  new java.io.ByteArrayOutputStream ();\r
-}while (this.need > 0) {\r
-if (this.z.avail_in == 0) {\r
-throw Clazz.innerTypeInstance (JU.Inflate.Return, this, null, r);\r
-}r = f;\r
-this.z.avail_in--;\r
-this.z.total_in++;\r
-this.tmp_string.write (this.z.next_in, this.z.next_in_index, 1);\r
-this.z.checksum.update (this.z.next_in, this.z.next_in_index, 1);\r
-this.z.next_in_index++;\r
-this.need--;\r
-}\r
-return r;\r
-}, "~N,~N");\r
-Clazz.defineMethod (c$, "checksum", \r
- function (n, v) {\r
-for (var i = 0; i < n; i++) {\r
-this.crcbuf[i] = (v & 0xff);\r
-v >>= 8;\r
-}\r
-this.z.checksum.update (this.crcbuf, 0, n);\r
-}, "~N,~N");\r
-Clazz.defineMethod (c$, "getGZIPHeader", \r
-function () {\r
-return this.gheader;\r
-});\r
-Clazz.defineMethod (c$, "inParsingHeader", \r
-function () {\r
-switch (this.mode) {\r
-case 14:\r
-case 2:\r
-case 3:\r
-case 4:\r
-case 5:\r
-case 23:\r
-case 16:\r
-case 17:\r
-case 18:\r
-case 19:\r
-case 20:\r
-case 21:\r
-case 22:\r
-return true;\r
-default:\r
-return false;\r
-}\r
-});\r
-c$.$Inflate$Return$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-this.r = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, JU.Inflate, "Return", Exception);\r
-Clazz.makeConstructor (c$, \r
-function (a) {\r
-Clazz.superConstructor (this, JU.Inflate.Return, []);\r
-this.r = a;\r
-}, "~N");\r
-c$ = Clazz.p0p ();\r
-};\r
-Clazz.defineStatics (c$,\r
-"PRESET_DICT", 0x20,\r
-"Z_NO_FLUSH", 0,\r
-"Z_PARTIAL_FLUSH", 1,\r
-"Z_SYNC_FLUSH", 2,\r
-"Z_FULL_FLUSH", 3,\r
-"Z_FINISH", 4,\r
-"Z_DEFLATED", 8,\r
-"Z_OK", 0,\r
-"Z_STREAM_END", 1,\r
-"Z_NEED_DICT", 2,\r
-"Z_STREAM_ERROR", -2,\r
-"Z_DATA_ERROR", -3,\r
-"Z_BUF_ERROR", -5,\r
-"DICT4", 2,\r
-"DICT3", 3,\r
-"DICT2", 4,\r
-"DICT1", 5,\r
-"DICT0", 6,\r
-"BLOCKS", 7,\r
-"CHECK4", 8,\r
-"CHECK3", 9,\r
-"CHECK2", 10,\r
-"CHECK1", 11,\r
-"DONE", 12,\r
-"BAD", 13,\r
-"HEAD", 14,\r
-"LENGTH", 15,\r
-"TIME", 16,\r
-"OS", 17,\r
-"EXLEN", 18,\r
-"EXTRA", 19,\r
-"NAME", 20,\r
-"COMMENT", 21,\r
-"HCRC", 22,\r
-"FLAGS", 23,\r
-"mark",  Clazz.newByteArray (-1, [0, 0, 0xff, 0xff]));\r
-});\r
+Clazz.declarePackage ("JU");
+Clazz.load (["java.lang.Exception"], "JU.Inflate", ["JU.Adler32", "$.CRC32", "$.GZIPHeader", "$.InfBlocks", "java.io.ByteArrayOutputStream"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.mode = 0;
+this.method = 0;
+this.was = -1;
+this.need = 0;
+this.marker = 0;
+this.wrap = 0;
+this.wbits = 0;
+this.blocks = null;
+this.z = null;
+this.flags = 0;
+this.need_bytes = -1;
+this.crcbuf = null;
+this.gheader = null;
+if (!Clazz.isClassDefined ("JU.Inflate.Return")) {
+JU.Inflate.$Inflate$Return$ ();
+}
+this.tmp_string = null;
+Clazz.instantialize (this, arguments);
+}, JU, "Inflate");
+Clazz.prepareFields (c$, function () {
+this.crcbuf =  Clazz.newByteArray (4, 0);
+});
+Clazz.defineMethod (c$, "reset", 
+function () {
+this.inflateReset ();
+});
+Clazz.defineMethod (c$, "inflateReset", 
+function () {
+if (this.z == null) return -2;
+this.z.total_in = this.z.total_out = 0;
+this.z.msg = null;
+this.mode = 14;
+this.need_bytes = -1;
+this.blocks.reset ();
+return 0;
+});
+Clazz.defineMethod (c$, "inflateEnd", 
+function () {
+if (this.blocks != null) {
+this.blocks.free ();
+}return 0;
+});
+Clazz.makeConstructor (c$, 
+function (z) {
+this.z = z;
+}, "JU.ZStream");
+Clazz.defineMethod (c$, "inflateInit", 
+function (w) {
+this.z.msg = null;
+this.blocks = null;
+this.wrap = 0;
+if (w < 0) {
+w = -w;
+} else {
+this.wrap = (w >> 4) + 1;
+if (w < 48) w &= 15;
+}if (w < 8 || w > 15) {
+this.inflateEnd ();
+return -2;
+}if (this.blocks != null && this.wbits != w) {
+this.blocks.free ();
+this.blocks = null;
+}this.wbits = w;
+this.blocks =  new JU.InfBlocks (this.z, 1 << w);
+this.inflateReset ();
+return 0;
+}, "~N");
+Clazz.defineMethod (c$, "inflate", 
+function (f) {
+var r;
+var b;
+if (this.z == null || this.z.next_in == null) {
+if (f == 4 && this.mode == 14) return 0;
+return -2;
+}f = f == 4 ? -5 : 0;
+r = -5;
+while (true) {
+switch (this.mode) {
+case 14:
+if (this.wrap == 0) {
+this.mode = 7;
+break;
+}try {
+r = this.readBytes (2, r, f);
+} catch (e) {
+if (Clazz.exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if ((this.wrap & 2) != 0 && this.need == 0x8b1f) {
+this.z.checksum =  new JU.CRC32 ();
+this.checksum (2, this.need);
+if (this.gheader == null) this.gheader =  new JU.GZIPHeader ();
+this.mode = 23;
+break;
+}this.flags = 0;
+this.method = (this.need) & 0xff;
+b = ((this.need >> 8)) & 0xff;
+if ((this.wrap & 1) == 0 || (((this.method << 8) + b) % 31) != 0) {
+this.mode = 13;
+this.z.msg = "incorrect header check";
+break;
+}if ((this.method & 0xf) != 8) {
+this.mode = 13;
+this.z.msg = "unknown compression method";
+break;
+}if ((this.method >> 4) + 8 > this.wbits) {
+this.mode = 13;
+this.z.msg = "invalid window size";
+break;
+}this.z.checksum =  new JU.Adler32 ();
+if ((b & 32) == 0) {
+this.mode = 7;
+break;
+}this.mode = 2;
+case 2:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need = ((this.z.next_in[this.z.next_in_index++] & 0xff) << 24) & 0xff000000;
+this.mode = 3;
+case 3:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 16) & 0xff0000;
+this.mode = 4;
+case 4:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 8) & 0xff00;
+this.mode = 5;
+case 5:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += (this.z.next_in[this.z.next_in_index++] & 0xff);
+this.z.checksum.resetLong (this.need);
+this.mode = 6;
+return 2;
+case 6:
+this.mode = 13;
+this.z.msg = "need dictionary";
+this.marker = 0;
+return -2;
+case 7:
+r = this.blocks.proc (r);
+if (r == -3) {
+this.mode = 13;
+this.marker = 0;
+break;
+}if (r == 0) {
+r = f;
+}if (r != 1) {
+return r;
+}r = f;
+this.was = this.z.checksum.getValue ();
+this.blocks.reset ();
+if (this.wrap == 0) {
+this.mode = 12;
+break;
+}this.mode = 8;
+case 8:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need = ((this.z.next_in[this.z.next_in_index++] & 0xff) << 24) & 0xff000000;
+this.mode = 9;
+case 9:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 16) & 0xff0000;
+this.mode = 10;
+case 10:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += ((this.z.next_in[this.z.next_in_index++] & 0xff) << 8) & 0xff00;
+this.mode = 11;
+case 11:
+if (this.z.avail_in == 0) return r;
+r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need += (this.z.next_in[this.z.next_in_index++] & 0xff);
+if (this.flags != 0) {
+this.need = ((this.need & 0xff000000) >> 24 | (this.need & 0x00ff0000) >> 8 | (this.need & 0x0000ff00) << 8 | (this.need & 0x0000ffff) << 24) & 0xffffffff;
+}if (((this.was)) != ((this.need))) {
+this.z.msg = "incorrect data check";
+} else if (this.flags != 0 && this.gheader != null) {
+this.gheader.crc = this.need;
+}this.mode = 15;
+case 15:
+if (this.wrap != 0 && this.flags != 0) {
+try {
+r = this.readBytes (4, r, f);
+} catch (e) {
+if (Clazz.exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if (this.z.msg != null && this.z.msg.equals ("incorrect data check")) {
+this.mode = 13;
+this.marker = 5;
+break;
+}if (this.need != (this.z.total_out & 0xffffffff)) {
+this.z.msg = "incorrect length check";
+this.mode = 13;
+break;
+}this.z.msg = null;
+} else {
+if (this.z.msg != null && this.z.msg.equals ("incorrect data check")) {
+this.mode = 13;
+this.marker = 5;
+break;
+}}this.mode = 12;
+case 12:
+return 1;
+case 13:
+return -3;
+case 23:
+try {
+r = this.readBytes (2, r, f);
+} catch (e) {
+if (Clazz.exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+this.flags = (this.need) & 0xffff;
+if ((this.flags & 0xff) != 8) {
+this.z.msg = "unknown compression method";
+this.mode = 13;
+break;
+}if ((this.flags & 0xe000) != 0) {
+this.z.msg = "unknown header flags set";
+this.mode = 13;
+break;
+}if ((this.flags & 0x0200) != 0) {
+this.checksum (2, this.need);
+}this.mode = 16;
+case 16:
+try {
+r = this.readBytes (4, r, f);
+} catch (e) {
+if (Clazz.exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if (this.gheader != null) this.gheader.time = this.need;
+if ((this.flags & 0x0200) != 0) {
+this.checksum (4, this.need);
+}this.mode = 17;
+case 17:
+try {
+r = this.readBytes (2, r, f);
+} catch (e) {
+if (Clazz.exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if (this.gheader != null) {
+this.gheader.xflags = (this.need) & 0xff;
+this.gheader.os = ((this.need) >> 8) & 0xff;
+}if ((this.flags & 0x0200) != 0) {
+this.checksum (2, this.need);
+}this.mode = 18;
+case 18:
+if ((this.flags & 0x0400) != 0) {
+try {
+r = this.readBytes (2, r, f);
+} catch (e) {
+if (Clazz.exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if (this.gheader != null) {
+this.gheader.extra =  Clazz.newByteArray ((this.need) & 0xffff, 0);
+}if ((this.flags & 0x0200) != 0) {
+this.checksum (2, this.need);
+}} else if (this.gheader != null) {
+this.gheader.extra = null;
+}this.mode = 19;
+case 19:
+if ((this.flags & 0x0400) != 0) {
+try {
+r = this.readBytes (r, f);
+if (this.gheader != null) {
+var foo = this.tmp_string.toByteArray ();
+this.tmp_string = null;
+if (foo.length == this.gheader.extra.length) {
+System.arraycopy (foo, 0, this.gheader.extra, 0, foo.length);
+} else {
+this.z.msg = "bad extra field length";
+this.mode = 13;
+break;
+}}} catch (e) {
+if (Clazz.exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+} else if (this.gheader != null) {
+this.gheader.extra = null;
+}this.mode = 20;
+case 20:
+if ((this.flags & 0x0800) != 0) {
+try {
+r = this.readString (r, f);
+if (this.gheader != null) {
+this.gheader.name = this.tmp_string.toByteArray ();
+}this.tmp_string = null;
+} catch (e) {
+if (Clazz.exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+} else if (this.gheader != null) {
+this.gheader.name = null;
+}this.mode = 21;
+case 21:
+if ((this.flags & 0x1000) != 0) {
+try {
+r = this.readString (r, f);
+if (this.gheader != null) {
+this.gheader.comment = this.tmp_string.toByteArray ();
+}this.tmp_string = null;
+} catch (e) {
+if (Clazz.exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+} else if (this.gheader != null) {
+this.gheader.comment = null;
+}this.mode = 22;
+case 22:
+if ((this.flags & 0x0200) != 0) {
+try {
+r = this.readBytes (2, r, f);
+} catch (e) {
+if (Clazz.exceptionOf (e, JU.Inflate.Return)) {
+return e.r;
+} else {
+throw e;
+}
+}
+if (this.gheader != null) {
+this.gheader.hcrc = (this.need & 0xffff);
+}if (this.need != (this.z.checksum.getValue () & 0xffff)) {
+this.mode = 13;
+this.z.msg = "header crc mismatch";
+this.marker = 5;
+break;
+}}this.z.checksum =  new JU.CRC32 ();
+this.mode = 7;
+break;
+default:
+return -2;
+}
+}
+}, "~N");
+Clazz.defineMethod (c$, "inflateSetDictionary", 
+function (dictionary, dictLength) {
+if (this.z == null || (this.mode != 6 && this.wrap != 0)) {
+return -2;
+}var index = 0;
+var length = dictLength;
+if (this.mode == 6) {
+var adler_need = this.z.checksum.getValue ();
+this.z.checksum.reset ();
+this.z.checksum.update (dictionary, 0, dictLength);
+if (this.z.checksum.getValue () != adler_need) {
+return -3;
+}}this.z.checksum.reset ();
+if (length >= (1 << this.wbits)) {
+length = (1 << this.wbits) - 1;
+index = dictLength - length;
+}this.blocks.set_dictionary (dictionary, index, length);
+this.mode = 7;
+return 0;
+}, "~A,~N");
+Clazz.defineMethod (c$, "inflateSync", 
+function () {
+var n;
+var p;
+var m;
+var r;
+var w;
+if (this.z == null) return -2;
+if (this.mode != 13) {
+this.mode = 13;
+this.marker = 0;
+}if ((n = this.z.avail_in) == 0) return -5;
+p = this.z.next_in_index;
+m = this.marker;
+while (n != 0 && m < 4) {
+if (this.z.next_in[p] == JU.Inflate.mark[m]) {
+m++;
+} else if (this.z.next_in[p] != 0) {
+m = 0;
+} else {
+m = 4 - m;
+}p++;
+n--;
+}
+this.z.total_in += p - this.z.next_in_index;
+this.z.next_in_index = p;
+this.z.avail_in = n;
+this.marker = m;
+if (m != 4) {
+return -3;
+}r = this.z.total_in;
+w = this.z.total_out;
+this.inflateReset ();
+this.z.total_in = r;
+this.z.total_out = w;
+this.mode = 7;
+return 0;
+});
+Clazz.defineMethod (c$, "inflateSyncPoint", 
+function () {
+if (this.z == null || this.blocks == null) return -2;
+return this.blocks.sync_point ();
+});
+Clazz.defineMethod (c$, "readBytes", 
+ function (n, r, f) {
+if (this.need_bytes == -1) {
+this.need_bytes = n;
+this.need = 0;
+}while (this.need_bytes > 0) {
+if (this.z.avail_in == 0) {
+throw Clazz.innerTypeInstance (JU.Inflate.Return, this, null, r);
+}r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.need = this.need | ((this.z.next_in[this.z.next_in_index++] & 0xff) << ((n - this.need_bytes) * 8));
+this.need_bytes--;
+}
+if (n == 2) {
+this.need &= 0xffff;
+} else if (n == 4) {
+this.need &= 0xffffffff;
+}this.need_bytes = -1;
+return r;
+}, "~N,~N,~N");
+Clazz.defineMethod (c$, "readString", 
+ function (r, f) {
+if (this.tmp_string == null) {
+this.tmp_string =  new java.io.ByteArrayOutputStream ();
+}var b = 0;
+do {
+if (this.z.avail_in == 0) {
+throw Clazz.innerTypeInstance (JU.Inflate.Return, this, null, r);
+}r = f;
+this.z.avail_in--;
+this.z.total_in++;
+b = this.z.next_in[this.z.next_in_index];
+if (b != 0) this.tmp_string.write (this.z.next_in, this.z.next_in_index, 1);
+this.z.checksum.update (this.z.next_in, this.z.next_in_index, 1);
+this.z.next_in_index++;
+} while (b != 0);
+return r;
+}, "~N,~N");
+Clazz.defineMethod (c$, "readBytes", 
+ function (r, f) {
+if (this.tmp_string == null) {
+this.tmp_string =  new java.io.ByteArrayOutputStream ();
+}while (this.need > 0) {
+if (this.z.avail_in == 0) {
+throw Clazz.innerTypeInstance (JU.Inflate.Return, this, null, r);
+}r = f;
+this.z.avail_in--;
+this.z.total_in++;
+this.tmp_string.write (this.z.next_in, this.z.next_in_index, 1);
+this.z.checksum.update (this.z.next_in, this.z.next_in_index, 1);
+this.z.next_in_index++;
+this.need--;
+}
+return r;
+}, "~N,~N");
+Clazz.defineMethod (c$, "checksum", 
+ function (n, v) {
+for (var i = 0; i < n; i++) {
+this.crcbuf[i] = (v & 0xff);
+v >>= 8;
+}
+this.z.checksum.update (this.crcbuf, 0, n);
+}, "~N,~N");
+Clazz.defineMethod (c$, "getGZIPHeader", 
+function () {
+return this.gheader;
+});
+Clazz.defineMethod (c$, "inParsingHeader", 
+function () {
+switch (this.mode) {
+case 14:
+case 2:
+case 3:
+case 4:
+case 5:
+case 23:
+case 16:
+case 17:
+case 18:
+case 19:
+case 20:
+case 21:
+case 22:
+return true;
+default:
+return false;
+}
+});
+c$.$Inflate$Return$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.r = 0;
+Clazz.instantialize (this, arguments);
+}, JU.Inflate, "Return", Exception);
+Clazz.makeConstructor (c$, 
+function (a) {
+Clazz.superConstructor (this, JU.Inflate.Return, []);
+this.r = a;
+}, "~N");
+c$ = Clazz.p0p ();
+};
+Clazz.defineStatics (c$,
+"PRESET_DICT", 0x20,
+"Z_NO_FLUSH", 0,
+"Z_PARTIAL_FLUSH", 1,
+"Z_SYNC_FLUSH", 2,
+"Z_FULL_FLUSH", 3,
+"Z_FINISH", 4,
+"Z_DEFLATED", 8,
+"Z_OK", 0,
+"Z_STREAM_END", 1,
+"Z_NEED_DICT", 2,
+"Z_STREAM_ERROR", -2,
+"Z_DATA_ERROR", -3,
+"Z_BUF_ERROR", -5,
+"DICT4", 2,
+"DICT3", 3,
+"DICT2", 4,
+"DICT1", 5,
+"DICT0", 6,
+"BLOCKS", 7,
+"CHECK4", 8,
+"CHECK3", 9,
+"CHECK2", 10,
+"CHECK1", 11,
+"DONE", 12,
+"BAD", 13,
+"HEAD", 14,
+"LENGTH", 15,
+"TIME", 16,
+"OS", 17,
+"EXLEN", 18,
+"EXTRA", 19,
+"NAME", 20,
+"COMMENT", 21,
+"HCRC", 22,
+"FLAGS", 23,
+"mark",  Clazz.newByteArray (-1, [0, 0, 0xff, 0xff]));
+});