public class StringPrintWriter
extends java.io.PrintWriter
A PrintWriter that maintains a String as its backing store.
Usage:
StringPrintWriter out = new StringPrintWriter(); printTo(out); System.out.println( out.getString() );
Constructor and Description |
---|
StringPrintWriter()
Constructs a new instance.
|
StringPrintWriter(int initialSize)
Constructs a new instance using the specified initial string-buffer
size.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getString()
Since toString() returns information *about* this object, we
want a separate method to extract just the contents of the
internal buffer as a String.
|
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write