1 Clazz.load(["java.io.Writer"],"java.io.CharArrayWriter",["java.lang.IllegalArgumentException","$.IndexOutOfBoundsException","$.NullPointerException","$.StringIndexOutOfBoundsException"],function(){
2 c$=Clazz.decorateAsClass(function(){
5 Clazz.instantialize(this,arguments);
6 },java.io,"CharArrayWriter",java.io.Writer);
7 Clazz.makeConstructor(c$,
9 Clazz.superConstructor(this,java.io.CharArrayWriter);
10 this.buf=Clazz.newArray(32,'\0');
13 Clazz.makeConstructor(c$,
14 function(initialSize){
15 Clazz.superConstructor(this,java.io.CharArrayWriter);
17 this.buf=Clazz.newArray(initialSize,'\0');
20 throw new IllegalArgumentException(("K005e"));
22 Clazz.overrideMethod(c$,"close",
25 Clazz.defineMethod(c$,"expand",
27 if(this.count+i<=this.buf.length){
29 }var newbuf=Clazz.newArray(this.buf.length+(2*i),'\0');
30 System.arraycopy(this.buf,0,newbuf,0,this.count);
32 },$fz.isPrivate=true,$fz),"~N");
33 Clazz.overrideMethod(c$,"flush",
36 Clazz.defineMethod(c$,"reset",
41 Clazz.defineMethod(c$,"size",
46 Clazz.defineMethod(c$,"toCharArray",
49 var result=Clazz.newArray(this.count,'\0');
50 System.arraycopy(this.buf,0,result,0,this.count);
53 Clazz.overrideMethod(c$,"toString",
56 return String.instantialize(this.buf,0,this.count);
58 Clazz.defineMethod(c$,"write",
59 function(c,offset,len){
60 if(0<=offset&&offset<=c.length&&0<=len&&len<=c.length-offset){
63 System.arraycopy(c,offset,this.buf,this.count,len);
66 throw new IndexOutOfBoundsException();
68 Clazz.defineMethod(c$,"write",
72 this.buf[this.count++]=String.fromCharCode(oneChar);
74 Clazz.defineMethod(c$,"write",
75 function(str,offset,len){
77 throw new NullPointerException(("K0047"));
78 }if(0<=offset&&offset<=str.length&&0<=len&&len<=str.length-offset){
81 str.getChars(offset,offset+len,this.buf,this.count);
84 throw new StringIndexOutOfBoundsException();
86 Clazz.defineMethod(c$,"writeTo",
89 out.write(this.buf,0,this.count);
91 Clazz.defineMethod(c$,"append",
93 this.write(c.charCodeAt(0));
96 Clazz.defineMethod(c$,"append",
99 this.append("null",0,"null".length);
101 this.append(csq,0,csq.length());
104 Clazz.defineMethod(c$,"append",
105 function(csq,start,end){
108 }var output=csq.subSequence(start,end).toString();
109 this.write(output,0,output.length);
111 },"CharSequence,~N,~N");