public class StringBuilderWriter extends Writer
| Constructor and Description |
|---|
StringBuilderWriter()Create a StringBuilderWriter with default capacity. |
StringBuilderWriter(int capacity)Create a StringBuilderWriter with specified capacity. |
| Modifier and Type | Method and Description |
|---|---|
Writer | append(char c)Append a character. |
Writer | append(CharSequence str)Append a character sequence. |
Writer | append(CharSequence str,
int off,
int len)Append a portion of a character sequence. |
void | close()Does nothing. |
void | flush()Does nothing. |
StringBuilder | getBuilder()Get the underlying StringBuilder. |
String | toString() |
void | write(char[] cbuf)Write a character array. |
void | write(char[] cbuf,
int off,
int len)Write a portion of a character array. |
void | write(int c)Write a single character. |
void | write(String str)Write a string. |
void | write(String str,
int off,
int len)Write a portion of a string. |
public StringBuilderWriter()
public StringBuilderWriter(int capacity)
capacity - the initial capacitypublic Writer append(char c)
append in interface Appendableappend in class Writerc - the character to appendpublic Writer append(CharSequence str)
append in interface Appendableappend in class Writerstr - the character sequence to appendpublic Writer append(CharSequence str, int off, int len)
append in interface Appendableappend in class Writerstr - the character sequenceoff - the start offsetlen - the number of characterspublic void close()
public void flush()
public StringBuilder getBuilder()
public void write(char[] cbuf)
public void write(char[] cbuf,
int off,
int len)public void write(int c)
public void write(String str)