org.infohazard.maverick.util
Class ServletOutputStreamBuffer
java.lang.Object
|
+--java.io.OutputStream
|
+--javax.servlet.ServletOutputStream
|
+--org.infohazard.maverick.util.ServletOutputStreamBuffer
- All Implemented Interfaces:
- Buffer
- public class ServletOutputStreamBuffer
- extends javax.servlet.ServletOutputStream
- implements Buffer
Method Summary |
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 always more efficient to use a reader because the buffer need
not be copied. |
int |
size()
|
void |
write(int b)
Overriden from ServletOutputStream |
Methods inherited from class javax.servlet.ServletOutputStream |
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println |
Methods inherited from class java.io.OutputStream |
close, flush, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
charset
protected java.lang.String charset
holder
protected FastByteArrayOutputStream holder
ServletOutputStreamBuffer
public ServletOutputStreamBuffer(java.lang.String charset)
- Parameters:
charset
- - if null, default character encoding is assumed.
prefersReader
public boolean prefersReader()
- It's always more efficient to use a reader because the buffer need
not be copied.
- 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.
write
public void write(int b)
throws java.io.IOException
- Overriden from ServletOutputStream
- Specified by:
write
in class java.io.OutputStream
java.io.IOException