1 Clazz.load(["java.io.FilterOutputStream"],"java.io.BufferedOutputStream",["java.lang.ArrayIndexOutOfBoundsException","$.IllegalArgumentException","$.NullPointerException"],function(){
2 c$=Clazz.decorateAsClass(function(){
5 Clazz.instantialize(this,arguments);
6 },java.io,"BufferedOutputStream",java.io.FilterOutputStream);
7 Clazz.makeConstructor(c$,
9 Clazz.superConstructor(this,java.io.BufferedOutputStream,[out]);
10 this.buf=Clazz.newArray(8192,0);
11 },"java.io.OutputStream");
12 Clazz.makeConstructor(c$,
14 Clazz.superConstructor(this,java.io.BufferedOutputStream,[out]);
16 throw new IllegalArgumentException(("K0058"));
17 }this.buf=Clazz.newArray(size,0);
18 },"java.io.OutputStream,~N");
19 Clazz.overrideMethod(c$,"flush",
22 this.out.write(this.buf,0,this.count);
26 Clazz.defineMethod(c$,"write",
27 function(buffer,offset,length){
29 throw new NullPointerException(("K0047"));
30 }if(offset<0||offset>buffer.length-length||length<0){
31 throw new ArrayIndexOutOfBoundsException(("K002f"));
32 }if(this.count==0&&length>=this.buf.length){
33 this.out.write(buffer,offset,length);
35 }var available=this.buf.length-this.count;
39 System.arraycopy(buffer,offset,this.buf,this.count,available);
40 this.count+=available;
41 }if(this.count==this.buf.length){
42 this.out.write(this.buf,0,this.buf.length);
46 available=length-available;
47 if(available>=this.buf.length){
48 this.out.write(buffer,offset,available);
50 System.arraycopy(buffer,offset,this.buf,this.count,available);
51 this.count+=available;
53 Clazz.defineMethod(c$,"write",
55 if(this.count==this.buf.length){
56 this.out.write(this.buf,0,this.count);
58 }this.buf[this.count++]=oneByte;