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