| java.lang.Object java.io.Writer java.io.StringWriter
StringWriter | public class StringWriter extends Writer (Code) | | A character stream that collects its output in a string buffer, which can
then be used to construct a string.
Closing a StringWriter has no effect. The methods in this class
can be called after the stream has been closed without generating an
IOException.
version: 1.18, 00/02/02 author: Mark Reinhold since: JDK1.1 |
Constructor Summary | |
public | StringWriter() Create a new string writer, using the default initial string-buffer
size. | public | StringWriter(int initialSize) Create a new string writer, using the specified initial string-buffer
size. |
Method Summary | |
public void | close() Closing a StringWriter has no effect. | public void | flush() Flush the stream. | public StringBuffer | getBuffer() Return the string buffer itself. | public String | toString() Return the buffer's current value as a string. | public void | write(int c) Write a single character. | public void | write(char cbuf, int off, int len) Write a portion of an array of characters. | public void | write(String str) Write a string. | public void | write(String str, int off, int len) Write a portion of a string. |
StringWriter | public StringWriter()(Code) | | Create a new string writer, using the default initial string-buffer
size.
|
StringWriter | public StringWriter(int initialSize)(Code) | | Create a new string writer, using the specified initial string-buffer
size.
Parameters: initialSize - an int specifying the initial size of the buffer. |
close | public void close() throws IOException(Code) | | Closing a StringWriter has no effect. The methods in this
class can be called after the stream has been closed without generating
an IOException.
|
flush | public void flush()(Code) | | Flush the stream.
|
getBuffer | public StringBuffer getBuffer()(Code) | | Return the string buffer itself.
StringBuffer holding the current buffer value. |
toString | public String toString()(Code) | | Return the buffer's current value as a string.
|
write | public void write(int c)(Code) | | Write a single character.
|
write | public void write(char cbuf, int off, int len)(Code) | | Write a portion of an array of characters.
Parameters: cbuf - Array of characters Parameters: off - Offset from which to start writing characters Parameters: len - Number of characters to write |
write | public void write(String str, int off, int len)(Code) | | Write a portion of a string.
Parameters: str - String to be written Parameters: off - Offset from which to start writing characters Parameters: len - Number of characters to write |
|
|