Module java.base
Package java.io

Class StringWriter

java.lang.Object
java.io.Writer
java.io.StringWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

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.

Since:
1.1