org.infohazard.maverick.util
Class PrintWriterBuffer

java.lang.Object
  |
  +--java.io.Writer
        |
        +--java.io.PrintWriter
              |
              +--org.infohazard.maverick.util.PrintWriterBuffer
All Implemented Interfaces:
Buffer

public class PrintWriterBuffer
extends java.io.PrintWriter
implements Buffer


Field Summary
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
PrintWriterBuffer()
           
 
Method Summary
 void close()
           
 java.io.Reader getAsReader()
          Produces a reader of the buffered data.
 java.lang.String getAsString()
          Produces the buffered data in string form.
 boolean prefersReader()
          It's more efficient to simply go directly to String.
 int size()
           
 
Methods inherited from class java.io.PrintWriter
checkError, flush, print, print, print, print, print, print, print, print, print, 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, toString, wait, wait, wait
 

Constructor Detail

PrintWriterBuffer

public PrintWriterBuffer()
Method Detail

prefersReader

public boolean prefersReader()
It's more efficient to simply go directly to String.

Specified by:
prefersReader in interface Buffer

getAsReader

public java.io.Reader getAsReader()
                           throws java.io.UnsupportedEncodingException
Description copied from interface: Buffer
Produces a reader of the buffered data.

Specified by:
getAsReader in interface Buffer
java.io.UnsupportedEncodingException

getAsString

public java.lang.String getAsString()
                             throws java.io.UnsupportedEncodingException
Description copied from interface: Buffer
Produces the buffered data in string form.

Specified by:
getAsString in interface Buffer
java.io.UnsupportedEncodingException

size

public int size()
Specified by:
size in interface Buffer
Returns:
the number of bytes or characters in the buffer.

close

public void close()
Overrides:
close in class java.io.PrintWriter