public class StringBuilderWriter extends Writer
StringWriter
using internally a StringBuilder instead of a StringBuffer.| Constructor and Description |
|---|
StringBuilderWriter()
Create a new string builder writer using the default initial string-builder buffer size.
|
StringBuilderWriter(int initialSize)
Create a new string builder writer using the specified initial string-builder buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
StringBuilderWriter |
append(char c) |
StringBuilderWriter |
append(CharSequence csq) |
StringBuilderWriter |
append(CharSequence csq,
int start,
int end) |
void |
close() |
void |
flush() |
String |
toString() |
void |
write(char[] cbuf,
int offset,
int length) |
void |
write(int c) |
void |
write(String str) |
void |
write(String str,
int offset,
int length) |
public StringBuilderWriter()
public StringBuilderWriter(int initialSize)
initialSize - The number of char values that will fit into this buffer
before it is automatically expandedIllegalArgumentException - If initialSize is negativepublic StringBuilderWriter append(CharSequence csq)
append in interface Appendableappend in class Writerpublic StringBuilderWriter append(CharSequence csq, int start, int end)
append in interface Appendableappend in class Writerpublic StringBuilderWriter append(char c)
append in interface Appendableappend in class Writerpublic void flush()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOException