File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010class StringBuilderWriter extends Writer {
1111 private final StringBuilder builder ;
1212
13+ /**
14+ * Create a new string builder writer using the default initial string-builder buffer size.
15+ */
1316 StringBuilderWriter () {
1417 builder = new StringBuilder ();
1518 lock = builder ;
1619 }
1720
18- StringBuilderWriter (int initialSize ) {
19- if (initialSize < 0 ) {
20- throw new IllegalArgumentException ("Negative buffer size" );
21- }
22- builder = new StringBuilder (initialSize );
23- lock = builder ;
24- }
25-
2621 @ Override
2722 public void write (int c ) {
2823 builder .append ((char ) c );
2924 }
3025
3126 @ Override
32- public void write (char cbuf [] , int offset , int length ) {
27+ public void write (char [] cbuf , int offset , int length ) {
3328 if ((offset < 0 ) || (offset > cbuf .length ) || (length < 0 ) ||
3429 ((offset + length ) > cbuf .length ) || ((offset + length ) < 0 )) {
3530 throw new IndexOutOfBoundsException ();
@@ -57,7 +52,9 @@ public StringBuilderWriter append(CharSequence csq) {
5752
5853 @ Override
5954 public StringBuilderWriter append (CharSequence csq , int start , int end ) {
60- if (csq == null ) csq = "null" ;
55+ if (csq == null ) {
56+ csq = "null" ;
57+ }
6158 return append (csq .subSequence (start , end ));
6259 }
6360
You can’t perform that action at this time.
0 commit comments