planetj.servlet.wrapper
Interface Buffer

All Known Implementing Classes:
PrintWriterBuffer, ServletOutputStreamBuffer

public interface Buffer

Simple interface to abstract out both ServletOutputStreams and PrintWriters.


Method Summary
 Reader getAsReader()
          Produces a reader of the buffered data.
 String getAsString()
          Produces the buffered data in string form.
 boolean prefersReader()
          True if it is more efficient to call toReader() than toString().
 int size()
           
 

Method Detail

getAsReader

public Reader getAsReader()
                   throws UnsupportedEncodingException
Produces a reader of the buffered data.

UnsupportedEncodingException

getAsString

public String getAsString()
                   throws UnsupportedEncodingException
Produces the buffered data in string form.

UnsupportedEncodingException

prefersReader

public boolean prefersReader()
True if it is more efficient to call toReader() than toString().


size

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