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