Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / util / zip / GZIPInputStream.js
index 5c2fc7d..f21829c 100644 (file)
-Clazz.declarePackage ("java.util.zip");\r
-Clazz.load (["java.util.zip.InflaterInputStream", "$.CRC32"], "java.util.zip.GZIPInputStream", ["java.io.EOFException", "$.IOException", "java.util.zip.CheckedInputStream", "$.Inflater", "$.ZipException"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.crc = null;\r
-this.eos = false;\r
-this.$closed = false;\r
-this.tmpbuf = null;\r
-Clazz.instantialize (this, arguments);\r
-}, java.util.zip, "GZIPInputStream", java.util.zip.InflaterInputStream);\r
-Clazz.prepareFields (c$, function () {\r
-this.crc =  new java.util.zip.CRC32 ();\r
-this.tmpbuf =  Clazz.newByteArray (128, 0);\r
-});\r
-Clazz.defineMethod (c$, "ensureOpen", \r
- function () {\r
-if (this.$closed) {\r
-throw  new java.io.IOException ("Stream closed");\r
-}});\r
-Clazz.makeConstructor (c$, \r
-function ($in, size) {\r
-Clazz.superConstructor (this, java.util.zip.GZIPInputStream, [$in,  new java.util.zip.Inflater ().init (0, true), size]);\r
-this.readHeader ($in);\r
-}, "java.io.InputStream,~N");\r
-Clazz.overrideMethod (c$, "read", \r
-function (buf, off, len) {\r
-this.ensureOpen ();\r
-if (this.eos) {\r
-return -1;\r
-}var n = this.readInf (buf, off, len);\r
-if (n == -1) {\r
-if (this.readTrailer ()) this.eos = true;\r
- else return this.read (buf, off, len);\r
-} else {\r
-this.crc.update (buf, off, n);\r
-}return n;\r
-}, "~A,~N,~N");\r
-Clazz.defineMethod (c$, "close", \r
-function () {\r
-if (!this.$closed) {\r
-Clazz.superCall (this, java.util.zip.GZIPInputStream, "close", []);\r
-this.eos = true;\r
-this.$closed = true;\r
-}});\r
-Clazz.defineMethod (c$, "readHeader", \r
- function (this_in) {\r
-var $in =  new java.util.zip.CheckedInputStream (this_in).set (this.crc);\r
-this.crc.reset ();\r
-if (this.readUShort ($in) != 35615) {\r
-throw  new java.util.zip.ZipException ("Not in GZIP format");\r
-}if (this.readUByte ($in) != 8) {\r
-throw  new java.util.zip.ZipException ("Unsupported compression method");\r
-}var flg = this.readUByte ($in);\r
-this.skipBytes ($in, 6);\r
-var n = 10;\r
-if ((flg & 4) == 4) {\r
-var m = this.readUShort ($in);\r
-this.skipBytes ($in, m);\r
-n += m + 2;\r
-}if ((flg & 8) == 8) {\r
-do {\r
-n++;\r
-} while (this.readUByte ($in) != 0);\r
-}if ((flg & 16) == 16) {\r
-do {\r
-n++;\r
-} while (this.readUByte ($in) != 0);\r
-}if ((flg & 2) == 2) {\r
-var v = this.crc.getValue () & 0xffff;\r
-if (this.readUShort ($in) != v) {\r
-throw  new java.util.zip.ZipException ("Corrupt GZIP header");\r
-}n += 2;\r
-}this.crc.reset ();\r
-return n;\r
-}, "java.io.InputStream");\r
-Clazz.defineMethod (c$, "readTrailer", \r
- function () {\r
-return true;\r
-});\r
-Clazz.defineMethod (c$, "readUShort", \r
- function ($in) {\r
-var b = this.readUByte ($in);\r
-return (this.readUByte ($in) << 8) | b;\r
-}, "java.io.InputStream");\r
-Clazz.defineMethod (c$, "readUByte", \r
- function ($in) {\r
-var b = $in.readByteAsInt ();\r
-if (b == -1) {\r
-throw  new java.io.EOFException ();\r
-}if (b < -1 || b > 255) {\r
-throw  new java.io.IOException (this.$in.getClass ().getName () + ".read() returned value out of range -1..255: " + b);\r
-}return b;\r
-}, "java.io.InputStream");\r
-Clazz.defineMethod (c$, "skipBytes", \r
- function ($in, n) {\r
-while (n > 0) {\r
-var len = $in.read (this.tmpbuf, 0, n < this.tmpbuf.length ? n : this.tmpbuf.length);\r
-if (len == -1) {\r
-throw  new java.io.EOFException ();\r
-}n -= len;\r
-}\r
-}, "java.io.InputStream,~N");\r
-Clazz.defineStatics (c$,\r
-"GZIP_MAGIC", 0x8b1f,\r
-"FHCRC", 2,\r
-"FEXTRA", 4,\r
-"FNAME", 8,\r
-"FCOMMENT", 16);\r
-});\r
+Clazz.declarePackage ("java.util.zip");
+Clazz.load (["java.util.zip.InflaterInputStream", "$.CRC32"], "java.util.zip.GZIPInputStream", ["java.io.EOFException", "$.IOException", "java.util.zip.CheckedInputStream", "$.Inflater", "$.ZipException"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.crc = null;
+this.eos = false;
+this.$closed = false;
+this.tmpbuf = null;
+Clazz.instantialize (this, arguments);
+}, java.util.zip, "GZIPInputStream", java.util.zip.InflaterInputStream);
+Clazz.prepareFields (c$, function () {
+this.crc =  new java.util.zip.CRC32 ();
+this.tmpbuf =  Clazz.newByteArray (128, 0);
+});
+Clazz.defineMethod (c$, "ensureOpen", 
+ function () {
+if (this.$closed) {
+throw  new java.io.IOException ("Stream closed");
+}});
+Clazz.makeConstructor (c$, 
+function ($in, size) {
+Clazz.superConstructor (this, java.util.zip.GZIPInputStream, [$in,  new java.util.zip.Inflater ().init (0, true), size]);
+this.readHeader ($in);
+}, "java.io.InputStream,~N");
+Clazz.overrideMethod (c$, "read", 
+function (buf, off, len) {
+this.ensureOpen ();
+if (this.eos) {
+return -1;
+}var n = this.readInf (buf, off, len);
+if (n == -1) {
+if (this.readTrailer ()) this.eos = true;
+ else return this.read (buf, off, len);
+} else {
+this.crc.update (buf, off, n);
+}return n;
+}, "~A,~N,~N");
+Clazz.defineMethod (c$, "close", 
+function () {
+if (!this.$closed) {
+Clazz.superCall (this, java.util.zip.GZIPInputStream, "close", []);
+this.eos = true;
+this.$closed = true;
+}});
+Clazz.defineMethod (c$, "readHeader", 
+ function (this_in) {
+var $in =  new java.util.zip.CheckedInputStream (this_in).set (this.crc);
+this.crc.reset ();
+if (this.readUShort ($in) != 35615) {
+throw  new java.util.zip.ZipException ("Not in GZIP format");
+}if (this.readUByte ($in) != 8) {
+throw  new java.util.zip.ZipException ("Unsupported compression method");
+}var flg = this.readUByte ($in);
+this.skipBytes ($in, 6);
+var n = 10;
+if ((flg & 4) == 4) {
+var m = this.readUShort ($in);
+this.skipBytes ($in, m);
+n += m + 2;
+}if ((flg & 8) == 8) {
+do {
+n++;
+} while (this.readUByte ($in) != 0);
+}if ((flg & 16) == 16) {
+do {
+n++;
+} while (this.readUByte ($in) != 0);
+}if ((flg & 2) == 2) {
+var v = this.crc.getValue () & 0xffff;
+if (this.readUShort ($in) != v) {
+throw  new java.util.zip.ZipException ("Corrupt GZIP header");
+}n += 2;
+}this.crc.reset ();
+return n;
+}, "java.io.InputStream");
+Clazz.defineMethod (c$, "readTrailer", 
+ function () {
+return true;
+});
+Clazz.defineMethod (c$, "readUShort", 
+ function ($in) {
+var b = this.readUByte ($in);
+return (this.readUByte ($in) << 8) | b;
+}, "java.io.InputStream");
+Clazz.defineMethod (c$, "readUByte", 
+ function ($in) {
+var b = $in.readByteAsInt ();
+if (b == -1) {
+throw  new java.io.EOFException ();
+}if (b < -1 || b > 255) {
+throw  new java.io.IOException (this.$in.getClass ().getName () + ".read() returned value out of range -1..255: " + b);
+}return b;
+}, "java.io.InputStream");
+Clazz.defineMethod (c$, "skipBytes", 
+ function ($in, n) {
+while (n > 0) {
+var len = $in.read (this.tmpbuf, 0, n < this.tmpbuf.length ? n : this.tmpbuf.length);
+if (len == -1) {
+throw  new java.io.EOFException ();
+}n -= len;
+}
+}, "java.io.InputStream,~N");
+Clazz.defineStatics (c$,
+"GZIP_MAGIC", 0x8b1f,
+"FHCRC", 2,
+"FEXTRA", 4,
+"FNAME", 8,
+"FCOMMENT", 16);
+});