Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / io / InputStreamReader.js
index 16f9ab5..794edeb 100644 (file)
@@ -1,81 +1,81 @@
-Clazz.load (["java.io.Reader"], "java.io.InputStreamReader", ["java.lang.NullPointerException"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.$in = null;\r
-this.isOpen = true;\r
-this.charsetName = null;\r
-this.isUTF8 = false;\r
-this.bytearr = null;\r
-this.pos = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, java.io, "InputStreamReader", java.io.Reader);\r
-Clazz.makeConstructor (c$, \r
-function ($in) {\r
-//just sets lock Clazz.superConstructor (this, java.io.InputStreamReader, [$in]);\r
-this.$in = $in;\r
-var charsetName = (arguments.length > 1 ? arguments[1] : "UTF-8");\r
-\r
-this.charsetName = charsetName;\r
-if (!(this.isUTF8 = "UTF-8".equals (charsetName)) && !"ISO-8859-1".equals (charsetName)) throw  new NullPointerException ("charsetName");\r
-}, "java.io.InputStream");\r
-Clazz.defineMethod (c$, "getEncoding", \r
-function () {\r
-return this.charsetName;\r
-});\r
-Clazz.overrideMethod (c$, "read", \r
-function (cbuf, offset, length) {\r
-if (this.bytearr == null || this.bytearr.length < length) this.bytearr =  Clazz.newByteArray (length, 0);\r
-var c;\r
-var char2;\r
-var char3;\r
-var byteCount = 0;\r
-var charCount = offset;\r
-var byteLen = this.$in.read (this.bytearr, this.pos, length - this.pos);\r
-var nAvail = this.$in.available ();\r
-if (byteLen < 0) return -1;\r
-var nMax = byteLen;\r
-while (byteCount < nMax) {\r
-c = this.bytearr[byteCount] & 0xff;\r
-if (this.isUTF8) switch (c >> 4) {\r
-case 0xC:\r
-case 0xD:\r
-if (byteCount + 1 >= byteLen) {\r
-if (nAvail >= 1) {\r
-nMax = byteCount;\r
-continue;\r
-}} else if (((char2 = this.bytearr[byteCount + 1]) & 0xC0) == 0x80) {\r
-cbuf[charCount++] = String.fromCharCode (((c & 0x1F) << 6) | (char2 & 0x3F));\r
-byteCount += 2;\r
-continue;\r
-}this.isUTF8 = false;\r
-break;\r
-case 0xE:\r
-if (byteCount + 2 >= byteLen) {\r
-if (nAvail >= 2) {\r
-nMax = byteCount;\r
-continue;\r
-}} else if (((char2 = this.bytearr[byteCount + 1]) & 0xC0) == 0x80 && ((char3 = this.bytearr[byteCount + 2]) & 0xC0) == 0x80) {\r
-cbuf[charCount++] = String.fromCharCode (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | (char3 & 0x3F));\r
-byteCount += 3;\r
-continue;\r
-}this.isUTF8 = false;\r
-break;\r
-}\r
-byteCount++;\r
-cbuf[charCount++] = String.fromCharCode (c);\r
-}\r
-this.pos = byteLen - byteCount;\r
-for (var i = 0; i < this.pos; i++) {\r
-this.bytearr[i] = this.bytearr[byteCount++];\r
-}\r
-return charCount - offset;\r
-}, "~A,~N,~N");\r
-Clazz.overrideMethod (c$, "ready", \r
-function () {\r
-return this.isOpen;\r
-});\r
-Clazz.overrideMethod (c$, "close", \r
-function () {\r
-this.$in.close ();\r
-this.isOpen = false;\r
-});\r
-});\r
+Clazz.load (["java.io.Reader"], "java.io.InputStreamReader", ["java.lang.NullPointerException"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.$in = null;
+this.isOpen = true;
+this.charsetName = null;
+this.isUTF8 = false;
+this.bytearr = null;
+this.pos = 0;
+Clazz.instantialize (this, arguments);
+}, java.io, "InputStreamReader", java.io.Reader);
+Clazz.makeConstructor (c$, 
+function ($in) {
+//just sets lock Clazz.superConstructor (this, java.io.InputStreamReader, [$in]);
+this.$in = $in;
+var charsetName = (arguments.length > 1 ? arguments[1] : "UTF-8");
+
+this.charsetName = charsetName;
+if (!(this.isUTF8 = "UTF-8".equals (charsetName)) && !"ISO-8859-1".equals (charsetName)) throw  new NullPointerException ("charsetName");
+}, "java.io.InputStream");
+Clazz.defineMethod (c$, "getEncoding", 
+function () {
+return this.charsetName;
+});
+Clazz.overrideMethod (c$, "read", 
+function (cbuf, offset, length) {
+if (this.bytearr == null || this.bytearr.length < length) this.bytearr =  Clazz.newByteArray (length, 0);
+var c;
+var char2;
+var char3;
+var byteCount = 0;
+var charCount = offset;
+var byteLen = this.$in.read (this.bytearr, this.pos, length - this.pos);
+var nAvail = this.$in.available ();
+if (byteLen < 0) return -1;
+var nMax = byteLen;
+while (byteCount < nMax) {
+c = this.bytearr[byteCount] & 0xff;
+if (this.isUTF8) switch (c >> 4) {
+case 0xC:
+case 0xD:
+if (byteCount + 1 >= byteLen) {
+if (nAvail >= 1) {
+nMax = byteCount;
+continue;
+}} else if (((char2 = this.bytearr[byteCount + 1]) & 0xC0) == 0x80) {
+cbuf[charCount++] = String.fromCharCode (((c & 0x1F) << 6) | (char2 & 0x3F));
+byteCount += 2;
+continue;
+}this.isUTF8 = false;
+break;
+case 0xE:
+if (byteCount + 2 >= byteLen) {
+if (nAvail >= 2) {
+nMax = byteCount;
+continue;
+}} else if (((char2 = this.bytearr[byteCount + 1]) & 0xC0) == 0x80 && ((char3 = this.bytearr[byteCount + 2]) & 0xC0) == 0x80) {
+cbuf[charCount++] = String.fromCharCode (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | (char3 & 0x3F));
+byteCount += 3;
+continue;
+}this.isUTF8 = false;
+break;
+}
+byteCount++;
+cbuf[charCount++] = String.fromCharCode (c);
+}
+this.pos = byteLen - byteCount;
+for (var i = 0; i < this.pos; i++) {
+this.bytearr[i] = this.bytearr[byteCount++];
+}
+return charCount - offset;
+}, "~A,~N,~N");
+Clazz.overrideMethod (c$, "ready", 
+function () {
+return this.isOpen;
+});
+Clazz.overrideMethod (c$, "close", 
+function () {
+this.$in.close ();
+this.isOpen = false;
+});
+});