public class StringBuilderWriter extends Writer
StringBufferWriter.StringWriter| Modifier and Type | Field and Description |
|---|---|
protected StringBuilder |
buffer |
| Constructor and Description |
|---|
StringBuilderWriter(StringBuilder buffer)
Create a new StringBufferWriter
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closing a StringBuilderWriter has no effect.
|
void |
flush()
Flush the stream.
|
StringBuilder |
getBuffer()
Return the string buffer itself.
|
String |
toString()
Return the buffer's current value as a string.
|
void |
write(char[] charArray,
int offset,
int length)
Write a portion of an array of characters.
|
void |
write(int c)
Write a single character.
|
void |
write(String str)
Write a string.
|
void |
write(String str,
int offset,
int length)
Write a portion of a string.
|
protected StringBuilder buffer
public StringBuilderWriter(StringBuilder buffer)
buffer - The StringBuffer to useNullPointerException - if buffer is null.public void write(char[] charArray,
int offset,
int length)
public void write(String str, int offset, int length)
public String toString()
public StringBuilder getBuffer()
public void flush()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionMMBase 1.9-SNAPSHOT - ${javadoctimestamp}