Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / io / BufferedOutputStream.js
index 5bf0d3f..fe30a38 100644 (file)
@@ -1,60 +1,60 @@
-Clazz.load(["java.io.FilterOutputStream"],"java.io.BufferedOutputStream",["java.lang.ArrayIndexOutOfBoundsException","$.IllegalArgumentException","$.NullPointerException"],function(){\r
-c$=Clazz.decorateAsClass(function(){\r
-this.buf=null;\r
-this.count=0;\r
-Clazz.instantialize(this,arguments);\r
-},java.io,"BufferedOutputStream",java.io.FilterOutputStream);\r
-Clazz.makeConstructor(c$,\r
-function(out){\r
-Clazz.superConstructor(this,java.io.BufferedOutputStream,[out]);\r
-this.buf=Clazz.newArray(8192,0);\r
-},"java.io.OutputStream");\r
-Clazz.makeConstructor(c$,\r
-function(out,size){\r
-Clazz.superConstructor(this,java.io.BufferedOutputStream,[out]);\r
-if(size<=0){\r
-throw new IllegalArgumentException(("K0058"));\r
-}this.buf=Clazz.newArray(size,0);\r
-},"java.io.OutputStream,~N");\r
-Clazz.overrideMethod(c$,"flush",\r
-function(){\r
-if(this.count>0){\r
-this.out.write(this.buf,0,this.count);\r
-}this.count=0;\r
-this.out.flush();\r
-});\r
-Clazz.defineMethod(c$,"write",\r
-function(buffer,offset,length){\r
-if(buffer==null){\r
-throw new NullPointerException(("K0047"));\r
-}if(offset<0||offset>buffer.length-length||length<0){\r
-throw new ArrayIndexOutOfBoundsException(("K002f"));\r
-}if(this.count==0&&length>=this.buf.length){\r
-this.out.write(buffer,offset,length);\r
-return;\r
-}var available=this.buf.length-this.count;\r
-if(length<available){\r
-available=length;\r
-}if(available>0){\r
-System.arraycopy(buffer,offset,this.buf,this.count,available);\r
-this.count+=available;\r
-}if(this.count==this.buf.length){\r
-this.out.write(this.buf,0,this.buf.length);\r
-this.count=0;\r
-if(length>available){\r
-offset+=available;\r
-available=length-available;\r
-if(available>=this.buf.length){\r
-this.out.write(buffer,offset,available);\r
-}else{\r
-System.arraycopy(buffer,offset,this.buf,this.count,available);\r
-this.count+=available;\r
-}}}},"~A,~N,~N");\r
-Clazz.defineMethod(c$,"write",\r
-function(oneByte){\r
-if(this.count==this.buf.length){\r
-this.out.write(this.buf,0,this.count);\r
-this.count=0;\r
-}this.buf[this.count++]=oneByte;\r
-},"~N");\r
-});\r
+Clazz.load(["java.io.FilterOutputStream"],"java.io.BufferedOutputStream",["java.lang.ArrayIndexOutOfBoundsException","$.IllegalArgumentException","$.NullPointerException"],function(){
+c$=Clazz.decorateAsClass(function(){
+this.buf=null;
+this.count=0;
+Clazz.instantialize(this,arguments);
+},java.io,"BufferedOutputStream",java.io.FilterOutputStream);
+Clazz.makeConstructor(c$,
+function(out){
+Clazz.superConstructor(this,java.io.BufferedOutputStream,[out]);
+this.buf=Clazz.newArray(8192,0);
+},"java.io.OutputStream");
+Clazz.makeConstructor(c$,
+function(out,size){
+Clazz.superConstructor(this,java.io.BufferedOutputStream,[out]);
+if(size<=0){
+throw new IllegalArgumentException(("K0058"));
+}this.buf=Clazz.newArray(size,0);
+},"java.io.OutputStream,~N");
+Clazz.overrideMethod(c$,"flush",
+function(){
+if(this.count>0){
+this.out.write(this.buf,0,this.count);
+}this.count=0;
+this.out.flush();
+});
+Clazz.defineMethod(c$,"write",
+function(buffer,offset,length){
+if(buffer==null){
+throw new NullPointerException(("K0047"));
+}if(offset<0||offset>buffer.length-length||length<0){
+throw new ArrayIndexOutOfBoundsException(("K002f"));
+}if(this.count==0&&length>=this.buf.length){
+this.out.write(buffer,offset,length);
+return;
+}var available=this.buf.length-this.count;
+if(length<available){
+available=length;
+}if(available>0){
+System.arraycopy(buffer,offset,this.buf,this.count,available);
+this.count+=available;
+}if(this.count==this.buf.length){
+this.out.write(this.buf,0,this.buf.length);
+this.count=0;
+if(length>available){
+offset+=available;
+available=length-available;
+if(available>=this.buf.length){
+this.out.write(buffer,offset,available);
+}else{
+System.arraycopy(buffer,offset,this.buf,this.count,available);
+this.count+=available;
+}}}},"~A,~N,~N");
+Clazz.defineMethod(c$,"write",
+function(oneByte){
+if(this.count==this.buf.length){
+this.out.write(this.buf,0,this.count);
+this.count=0;
+}this.buf[this.count++]=oneByte;
+},"~N");
+});