StringWriter

public class StringWriter extends Writer

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.

Inherited Field Summary

Public Constructor Summary

StringWriter()
Create a new string writer using the default initial string-buffer size.
StringWriter(int initialSize)
Create a new string writer using the specified initial string-buffer size.

Public Method Summary

StringWriter
append(char c)
Appends the specified character to this writer.
StringWriter
append(CharSequence csq, int start, int end)
Appends a subsequence of the specified character sequence to this writer.
StringWriter
append(CharSequence csq)
Appends the specified character sequence to this writer.
void
close()
Closing a StringWriter has no effect.
void
flush()
Flush the stream.