com.evanmclean.evlib.io
Class PrintStringWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by com.evanmclean.evlib.io.PrintStringWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class PrintStringWriter
extends PrintWriter

Combines a PrintWriter with a StringWriter.

Author:
Evan McLean McLean Computer Services (see the overview for copyright and licensing.)

Field Summary
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
PrintStringWriter()
          Create a new print string writer using the default initial string-buffer size.
PrintStringWriter(int initialSize)
          Create a new print string writer using the specified initial string-buffer size.
 
Method Summary
 StringBuffer getBuffer()
          Return the string buffer itself.
 String toString()
          Return the buffer's current value as a string.
 
Methods inherited from class java.io.PrintWriter
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrintStringWriter

public PrintStringWriter()
Create a new print string writer using the default initial string-buffer size.


PrintStringWriter

public PrintStringWriter(int initialSize)
Create a new print string writer using the specified initial string-buffer size.

Parameters:
initialSize - The number of char values that will fit into this buffer before it is automatically expanded.
Method Detail

getBuffer

public StringBuffer getBuffer()
Return the string buffer itself.

Returns:
StringBuffer holding the current buffer value.

toString

public String toString()
Return the buffer's current value as a string.

Overrides:
toString in class Object