Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / JU / ZStream.js
index b867721..d632a93 100644 (file)
-Clazz.declarePackage ("JU");\r
-Clazz.load (null, "JU.ZStream", ["JU.Adler32"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.next_in = null;\r
-this.next_in_index = 0;\r
-this.avail_in = 0;\r
-this.total_in = 0;\r
-this.next_out = null;\r
-this.next_out_index = 0;\r
-this.avail_out = 0;\r
-this.total_out = 0;\r
-this.msg = null;\r
-this.dstate = null;\r
-this.istate = null;\r
-this.data_type = 0;\r
-this.checksum = null;\r
-Clazz.instantialize (this, arguments);\r
-}, JU, "ZStream");\r
-Clazz.defineMethod (c$, "setAdler32", \r
-function () {\r
-this.checksum =  new JU.Adler32 ();\r
-});\r
-Clazz.defineMethod (c$, "inflate", \r
-function (f) {\r
-if (this.istate == null) return -2;\r
-return this.istate.inflate (f);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "deflate", \r
-function (flush) {\r
-if (this.dstate == null) {\r
-return -2;\r
-}return this.dstate.deflate (flush);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "flush_pending", \r
-function () {\r
-var len = this.dstate.pending;\r
-if (len > this.avail_out) len = this.avail_out;\r
-if (len == 0) return;\r
-System.arraycopy (this.dstate.pending_buf, this.dstate.pending_out, this.next_out, this.next_out_index, len);\r
-this.next_out_index += len;\r
-this.dstate.pending_out += len;\r
-this.total_out += len;\r
-this.avail_out -= len;\r
-this.dstate.pending -= len;\r
-if (this.dstate.pending == 0) {\r
-this.dstate.pending_out = 0;\r
-}});\r
-Clazz.defineMethod (c$, "read_buf", \r
-function (buf, start, size) {\r
-var len = this.avail_in;\r
-if (len > size) len = size;\r
-if (len == 0) return 0;\r
-this.avail_in -= len;\r
-if (this.dstate.wrap != 0) {\r
-this.checksum.update (this.next_in, this.next_in_index, len);\r
-}System.arraycopy (this.next_in, this.next_in_index, buf, start, len);\r
-this.next_in_index += len;\r
-this.total_in += len;\r
-return len;\r
-}, "~A,~N,~N");\r
-Clazz.defineMethod (c$, "getAdler", \r
-function () {\r
-return this.checksum.getValue ();\r
-});\r
-Clazz.defineMethod (c$, "free", \r
-function () {\r
-this.next_in = null;\r
-this.next_out = null;\r
-this.msg = null;\r
-});\r
-Clazz.defineMethod (c$, "setOutput", \r
-function (buf, off, len) {\r
-this.next_out = buf;\r
-this.next_out_index = off;\r
-this.avail_out = len;\r
-}, "~A,~N,~N");\r
-Clazz.defineMethod (c$, "setInput", \r
-function (buf, off, len, append) {\r
-if (len <= 0 && append && this.next_in != null) return;\r
-if (this.avail_in > 0 && append) {\r
-var tmp =  Clazz.newByteArray (this.avail_in + len, 0);\r
-System.arraycopy (this.next_in, this.next_in_index, tmp, 0, this.avail_in);\r
-System.arraycopy (buf, off, tmp, this.avail_in, len);\r
-this.next_in = tmp;\r
-this.next_in_index = 0;\r
-this.avail_in += len;\r
-} else {\r
-this.next_in = buf;\r
-this.next_in_index = off;\r
-this.avail_in = len;\r
-}}, "~A,~N,~N,~B");\r
-Clazz.defineMethod (c$, "getAvailIn", \r
-function () {\r
-return this.avail_in;\r
-});\r
-Clazz.defineMethod (c$, "getTotalOut", \r
-function () {\r
-return this.total_out;\r
-});\r
-Clazz.defineMethod (c$, "getTotalIn", \r
-function () {\r
-return this.total_in;\r
-});\r
-c$.getBytes = Clazz.defineMethod (c$, "getBytes", \r
-function (s) {\r
-{\r
-var x = [];\r
-for (var i = 0; i < s.length;i++) {\r
-var pt = s.charCodeAt(i);\r
-if (pt <= 0x7F) {\r
-x.push(pt);\r
-} else if (pt <= 0x7FF) {\r
-x.push(0xC0|((pt>>6)&0x1F));\r
-x.push(0x80|(pt&0x3F));\r
-} else if (pt <= 0xFFFF) {\r
-x.push(0xE0|((pt>>12)&0xF));\r
-x.push(0x80|((pt>>6)&0x3F));\r
-x.push(0x80|(pt&0x3F));\r
-} else {\r
-x.push(0x3F); // '?'\r
-}\r
-}\r
-return (Int32Array != Array ? new Int32Array(x) : x);\r
-}}, "~S");\r
-Clazz.defineStatics (c$,\r
-"Z_STREAM_ERROR", -2);\r
-});\r
+Clazz.declarePackage ("JU");
+Clazz.load (null, "JU.ZStream", ["JU.Adler32"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.next_in = null;
+this.next_in_index = 0;
+this.avail_in = 0;
+this.total_in = 0;
+this.next_out = null;
+this.next_out_index = 0;
+this.avail_out = 0;
+this.total_out = 0;
+this.msg = null;
+this.dstate = null;
+this.istate = null;
+this.data_type = 0;
+this.checksum = null;
+Clazz.instantialize (this, arguments);
+}, JU, "ZStream");
+Clazz.defineMethod (c$, "setAdler32", 
+function () {
+this.checksum =  new JU.Adler32 ();
+});
+Clazz.defineMethod (c$, "inflate", 
+function (f) {
+if (this.istate == null) return -2;
+return this.istate.inflate (f);
+}, "~N");
+Clazz.defineMethod (c$, "deflate", 
+function (flush) {
+if (this.dstate == null) {
+return -2;
+}return this.dstate.deflate (flush);
+}, "~N");
+Clazz.defineMethod (c$, "flush_pending", 
+function () {
+var len = this.dstate.pending;
+if (len > this.avail_out) len = this.avail_out;
+if (len == 0) return;
+System.arraycopy (this.dstate.pending_buf, this.dstate.pending_out, this.next_out, this.next_out_index, len);
+this.next_out_index += len;
+this.dstate.pending_out += len;
+this.total_out += len;
+this.avail_out -= len;
+this.dstate.pending -= len;
+if (this.dstate.pending == 0) {
+this.dstate.pending_out = 0;
+}});
+Clazz.defineMethod (c$, "read_buf", 
+function (buf, start, size) {
+var len = this.avail_in;
+if (len > size) len = size;
+if (len == 0) return 0;
+this.avail_in -= len;
+if (this.dstate.wrap != 0) {
+this.checksum.update (this.next_in, this.next_in_index, len);
+}System.arraycopy (this.next_in, this.next_in_index, buf, start, len);
+this.next_in_index += len;
+this.total_in += len;
+return len;
+}, "~A,~N,~N");
+Clazz.defineMethod (c$, "getAdler", 
+function () {
+return this.checksum.getValue ();
+});
+Clazz.defineMethod (c$, "free", 
+function () {
+this.next_in = null;
+this.next_out = null;
+this.msg = null;
+});
+Clazz.defineMethod (c$, "setOutput", 
+function (buf, off, len) {
+this.next_out = buf;
+this.next_out_index = off;
+this.avail_out = len;
+}, "~A,~N,~N");
+Clazz.defineMethod (c$, "setInput", 
+function (buf, off, len, append) {
+if (len <= 0 && append && this.next_in != null) return;
+if (this.avail_in > 0 && append) {
+var tmp =  Clazz.newByteArray (this.avail_in + len, 0);
+System.arraycopy (this.next_in, this.next_in_index, tmp, 0, this.avail_in);
+System.arraycopy (buf, off, tmp, this.avail_in, len);
+this.next_in = tmp;
+this.next_in_index = 0;
+this.avail_in += len;
+} else {
+this.next_in = buf;
+this.next_in_index = off;
+this.avail_in = len;
+}}, "~A,~N,~N,~B");
+Clazz.defineMethod (c$, "getAvailIn", 
+function () {
+return this.avail_in;
+});
+Clazz.defineMethod (c$, "getTotalOut", 
+function () {
+return this.total_out;
+});
+Clazz.defineMethod (c$, "getTotalIn", 
+function () {
+return this.total_in;
+});
+c$.getBytes = Clazz.defineMethod (c$, "getBytes", 
+function (s) {
+{
+var x = [];
+for (var i = 0; i < s.length;i++) {
+var pt = s.charCodeAt(i);
+if (pt <= 0x7F) {
+x.push(pt);
+} else if (pt <= 0x7FF) {
+x.push(0xC0|((pt>>6)&0x1F));
+x.push(0x80|(pt&0x3F));
+} else if (pt <= 0xFFFF) {
+x.push(0xE0|((pt>>12)&0xF));
+x.push(0x80|((pt>>6)&0x3F));
+x.push(0x80|(pt&0x3F));
+} else {
+x.push(0x3F); // '?'
+}
+}
+return (Int32Array != Array ? new Int32Array(x) : x);
+}}, "~S");
+Clazz.defineStatics (c$,
+"Z_STREAM_ERROR", -2);
+});