public class StringBufferWriter
extends java.io.Writer
Constructor and Description |
---|
StringBufferWriter(java.lang.StringBuffer buffer)
Create a new string writer which will append the text to the given StringBuffer
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closing a StringWriter has no effect.
|
void |
flush()
Flush the stream.
|
java.lang.String |
toString()
Return the buffer's current value as a string.
|
void |
write(char[] text,
int offset,
int length)
Write a portion of an array of characters.
|
void |
write(int c)
Write a single character.
|
void |
write(java.lang.String text)
Write a string.
|
void |
write(java.lang.String text,
int offset,
int length)
Write a portion of a string.
|
public StringBufferWriter(java.lang.StringBuffer buffer)
public void write(int c)
write
in class java.io.Writer
public void write(char[] text, int offset, int length)
write
in class java.io.Writer
text
- Array of charactersoffset
- Offset from which to start writing characterslength
- Number of characters to writepublic void write(java.lang.String text)
write
in class java.io.Writer
public void write(java.lang.String text, int offset, int length)
write
in class java.io.Writer
text
- the text to be writtenoffset
- offset from which to start writing characterslength
- Number of characters to writepublic java.lang.String toString()
toString
in class java.lang.Object
public void flush()
flush
in interface java.io.Flushable
flush
in class java.io.Writer
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
java.io.IOException