1 Clazz.load(["java.io.Writer"],"java.io.StringWriter",["java.lang.IllegalArgumentException","$.IndexOutOfBoundsException","$.StringBuffer"],function(){
2 c$=Clazz.decorateAsClass(function(){
4 Clazz.instantialize(this,arguments);
5 },java.io,"StringWriter",java.io.Writer);
6 Clazz.makeConstructor(c$,
8 Clazz.superConstructor(this,java.io.StringWriter);
9 this.buf=new StringBuffer(16);
12 Clazz.makeConstructor(c$,
13 function(initialSize){
14 Clazz.superConstructor(this,java.io.StringWriter,[]);
16 this.buf=new StringBuffer(initialSize);
19 throw new IllegalArgumentException();
21 Clazz.overrideMethod(c$,"close",
24 Clazz.overrideMethod(c$,"flush",
27 Clazz.defineMethod(c$,"getBuffer",
32 Clazz.overrideMethod(c$,"toString",
35 return this.buf.toString();
37 Clazz.defineMethod(c$,"write",
38 function(cbuf,offset,count){
39 if(0<=offset&&offset<=cbuf.length&&0<=count&&count<=cbuf.length-offset){
41 this.buf.append(cbuf,offset,count);
43 throw new IndexOutOfBoundsException();
45 Clazz.defineMethod(c$,"write",
48 this.buf.append(String.fromCharCode(oneChar));
50 Clazz.defineMethod(c$,"write",
55 Clazz.defineMethod(c$,"write",
56 function(str,offset,count){
57 var sub=str.substring(offset,offset+count);
61 Clazz.defineMethod(c$,"append",
63 this.write(c.charCodeAt(0));
66 Clazz.defineMethod(c$,"append",
69 this.append("null",0,"null".length);
71 this.append(csq,0,csq.length());
74 Clazz.defineMethod(c$,"append",
75 function(csq,start,end){
78 }var output=csq.subSequence(start,end).toString();
79 this.write(output,0,output.length);
81 },"CharSequence,~N,~N");