public class StringBufferWriter extends Writer
StringWriter| Modifier and Type | Field and Description |
|---|---|
protected StringBuffer |
buffer |
| Constructor and Description |
|---|
StringBufferWriter(StringBuffer buffer)
Create a new StringBufferWriter
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closing a StringBufferWriter has no effect.
|
void |
flush()
Flush the stream.
|
StringBuffer |
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 StringBuffer buffer
public StringBufferWriter(StringBuffer 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 StringBuffer getBuffer()
public void flush()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionMMBase 1.9-SNAPSHOT - ${javadoctimestamp}