1 Clazz.load(["java.io.Writer"],"java.io.BufferedWriter",["java.io.IOException","java.lang.IllegalArgumentException","$.IndexOutOfBoundsException","$.StringIndexOutOfBoundsException"],function(){
2 c$=Clazz.decorateAsClass(function(){
6 this.lineSeparator="\r\n";
7 Clazz.instantialize(this,arguments);
8 },java.io,"BufferedWriter",java.io.Writer);
9 Clazz.makeConstructor(c$,
11 Clazz.superConstructor(this,java.io.BufferedWriter,[out]);
13 this.buf=Clazz.newArray(8192,'\0');
15 Clazz.makeConstructor(c$,
17 Clazz.superConstructor(this,java.io.BufferedWriter,[out]);
20 this.buf=Clazz.newArray(size,'\0');
22 throw new IllegalArgumentException(("K0058"));
23 }},"java.io.Writer,~N");
24 Clazz.defineMethod(c$,"close",
33 Clazz.defineMethod(c$,"flush",
38 this.out.write(this.buf,0,this.pos);
42 throw new java.io.IOException(("K005d"));
44 Clazz.defineMethod(c$,"isOpen",
46 return this.out!=null;
47 },$fz.isPrivate=true,$fz));
48 Clazz.defineMethod(c$,"newLine",
50 this.write("\r\n",0,"\r\n".length);
52 Clazz.defineMethod(c$,"write",
53 function(cbuf,offset,count){
56 throw new java.io.IOException(("K005d"));
57 }if(offset<0||offset>cbuf.length-count||count<0){
58 throw new IndexOutOfBoundsException();
59 }if(this.pos==0&&count>=this.buf.length){
60 this.out.write(cbuf,offset,count);
62 }var available=this.buf.length-this.pos;
66 System.arraycopy(cbuf,offset,this.buf,this.pos,available);
68 }if(this.pos==this.buf.length){
69 this.out.write(this.buf,0,this.buf.length);
73 available=count-available;
74 if(available>=this.buf.length){
75 this.out.write(cbuf,offset,available);
77 }System.arraycopy(cbuf,offset,this.buf,this.pos,available);
80 Clazz.defineMethod(c$,"write",
84 if(this.pos>=this.buf.length){
85 this.out.write(this.buf,0,this.buf.length);
87 }this.buf[this.pos++]=String.fromCharCode(oneChar);
89 throw new java.io.IOException(("K005d"));
91 Clazz.defineMethod(c$,"write",
92 function(str,offset,count){
95 throw new java.io.IOException(("K005d"));
98 }if(offset>str.length-count||offset<0){
99 throw new StringIndexOutOfBoundsException();
100 }if(this.pos==0&&count>=this.buf.length){
101 var chars=Clazz.newArray(count,'\0');
102 str.getChars(offset,offset+count,chars,0);
103 this.out.write(chars,0,count);
105 }var available=this.buf.length-this.pos;
109 str.getChars(offset,offset+available,this.buf,this.pos);
111 }if(this.pos==this.buf.length){
112 this.out.write(this.buf,0,this.buf.length);
116 available=count-available;
117 if(available>=this.buf.length){
118 var chars=Clazz.newArray(count,'\0');
119 str.getChars(offset,offset+available,chars,0);
120 this.out.write(chars,0,available);
122 }str.getChars(offset,offset+available,this.buf,this.pos);