Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / io / ByteArrayOutputStream.js
index 6aade87..8531c8b 100644 (file)
@@ -1,75 +1,75 @@
-Clazz.load (["java.io.OutputStream"], "java.io.ByteArrayOutputStream", ["java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "$.OutOfMemoryError"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.buf = null;\r
-this.count = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, java.io, "ByteArrayOutputStream", java.io.OutputStream);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-this.construct (32);\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (size) {\r
-Clazz.superConstructor (this, java.io.ByteArrayOutputStream, []);\r
-if (size < 0) {\r
-throw  new IllegalArgumentException ("Negative initial size: " + size);\r
-}this.buf =  Clazz.newByteArray (size, 0);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "ensureCapacity", \r
- function (minCapacity) {\r
-if (minCapacity - this.buf.length > 0) this.grow (minCapacity);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "grow", \r
- function (minCapacity) {\r
-var oldCapacity = this.buf.length;\r
-var newCapacity = oldCapacity << 1;\r
-if (newCapacity - minCapacity < 0) newCapacity = minCapacity;\r
-if (newCapacity < 0) {\r
-if (minCapacity < 0) throw  new OutOfMemoryError ();\r
-newCapacity = minCapacity;\r
-}this.buf = java.io.ByteArrayOutputStream.arrayCopyByte (this.buf, newCapacity);\r
-}, "~N");\r
-c$.arrayCopyByte = Clazz.defineMethod (c$, "arrayCopyByte", \r
- function (array, newLength) {\r
-var t =  Clazz.newByteArray (newLength, 0);\r
-System.arraycopy (array, 0, t, 0, array.length < newLength ? array.length : newLength);\r
-return t;\r
-}, "~A,~N");\r
-Clazz.overrideMethod (c$, "writeByteAsInt", \r
-function (b) {\r
-this.ensureCapacity (this.count + 1);\r
-this.buf[this.count] = b;\r
-this.count += 1;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "write", \r
-function (b, off, len) {\r
-if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) - b.length > 0)) {\r
-throw  new IndexOutOfBoundsException ();\r
-}this.ensureCapacity (this.count + len);\r
-System.arraycopy (b, off, this.buf, this.count, len);\r
-this.count += len;\r
-}, "~A,~N,~N");\r
-Clazz.defineMethod (c$, "writeTo", \r
-function (out) {\r
-out.write (this.buf, 0, this.count);\r
-}, "java.io.OutputStream");\r
-Clazz.defineMethod (c$, "reset", \r
-function () {\r
-this.count = 0;\r
-});\r
-Clazz.defineMethod (c$, "toByteArray", \r
-function () {\r
-return (this.count == this.buf.length ? this.buf : java.io.ByteArrayOutputStream.arrayCopyByte (this.buf, this.count));\r
-});\r
-Clazz.defineMethod (c$, "size", \r
-function () {\r
-return this.count;\r
-});\r
-Clazz.overrideMethod (c$, "toString", \r
-function () {\r
-return  String.instantialize (this.buf, 0, this.count);\r
-});\r
-Clazz.overrideMethod (c$, "close", \r
-function () {\r
-});\r
-});\r
+Clazz.load (["java.io.OutputStream"], "java.io.ByteArrayOutputStream", ["java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "$.OutOfMemoryError"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.buf = null;
+this.count = 0;
+Clazz.instantialize (this, arguments);
+}, java.io, "ByteArrayOutputStream", java.io.OutputStream);
+Clazz.makeConstructor (c$, 
+function () {
+this.construct (32);
+});
+Clazz.makeConstructor (c$, 
+function (size) {
+Clazz.superConstructor (this, java.io.ByteArrayOutputStream, []);
+if (size < 0) {
+throw  new IllegalArgumentException ("Negative initial size: " + size);
+}this.buf =  Clazz.newByteArray (size, 0);
+}, "~N");
+Clazz.defineMethod (c$, "ensureCapacity", 
+ function (minCapacity) {
+if (minCapacity - this.buf.length > 0) this.grow (minCapacity);
+}, "~N");
+Clazz.defineMethod (c$, "grow", 
+ function (minCapacity) {
+var oldCapacity = this.buf.length;
+var newCapacity = oldCapacity << 1;
+if (newCapacity - minCapacity < 0) newCapacity = minCapacity;
+if (newCapacity < 0) {
+if (minCapacity < 0) throw  new OutOfMemoryError ();
+newCapacity = minCapacity;
+}this.buf = java.io.ByteArrayOutputStream.arrayCopyByte (this.buf, newCapacity);
+}, "~N");
+c$.arrayCopyByte = Clazz.defineMethod (c$, "arrayCopyByte", 
+ function (array, newLength) {
+var t =  Clazz.newByteArray (newLength, 0);
+System.arraycopy (array, 0, t, 0, array.length < newLength ? array.length : newLength);
+return t;
+}, "~A,~N");
+Clazz.overrideMethod (c$, "writeByteAsInt", 
+function (b) {
+this.ensureCapacity (this.count + 1);
+this.buf[this.count] = b;
+this.count += 1;
+}, "~N");
+Clazz.defineMethod (c$, "write", 
+function (b, off, len) {
+if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) - b.length > 0)) {
+throw  new IndexOutOfBoundsException ();
+}this.ensureCapacity (this.count + len);
+System.arraycopy (b, off, this.buf, this.count, len);
+this.count += len;
+}, "~A,~N,~N");
+Clazz.defineMethod (c$, "writeTo", 
+function (out) {
+out.write (this.buf, 0, this.count);
+}, "java.io.OutputStream");
+Clazz.defineMethod (c$, "reset", 
+function () {
+this.count = 0;
+});
+Clazz.defineMethod (c$, "toByteArray", 
+function () {
+return (this.count == this.buf.length ? this.buf : java.io.ByteArrayOutputStream.arrayCopyByte (this.buf, this.count));
+});
+Clazz.defineMethod (c$, "size", 
+function () {
+return this.count;
+});
+Clazz.overrideMethod (c$, "toString", 
+function () {
+return  String.instantialize (this.buf, 0, this.count);
+});
+Clazz.overrideMethod (c$, "close", 
+function () {
+});
+});