java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.BufferedOutputStream
org.enhydra.servlet.connectionMethods.EnhydraDirector.EnhydraDirectorBufferedOutputStream
- public class EnhydraDirectorBufferedOutputStream
- extends java.io.BufferedOutputStream
Extension of BufferedOutputStream to allow "reset" of
the buffer.
A servlet container's ServletResponse object should
not go into the "committed" (data sent) state until the headers
have actually been sent over the wire. This allows a servlet to
specify a large buffer size and be able to reset or change headers
well after the first byte of data has been written to the
ServletOutputStream.
This class has a reset() that, after checking for
committed state of the connection, discards any buffered data
and self destructs, dropping any reference to its internally
held output stream. Once reset() has been called,
this object must be discarded as it is then useless. A new
instance should be created in its place.
|
Method Summary |
void |
flush()
Flushes outgoing data, then flushes the contained output stream. |
void |
reset()
Discards buffered data and drops reference to the output stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
conn
private EnhydraDirectorConnection conn
- Internal reference for for this stream's underlying connection.
EnhydraDirectorBufferedOutputStream
public EnhydraDirectorBufferedOutputStream(java.io.OutputStream os,
int size,
EnhydraDirectorConnection connection)
- Creates a new instance with the specified connection context,
OutputStream, and buffer size.
reset
public void reset()
throws java.lang.IllegalStateException
- Discards buffered data and drops reference to the output stream.
If the current connection has not sent any data over the wire,
this method drops any buffered data, as well as the output stream
reference, to ensure that this instance makes no further calls
to the underlying stream. It is expected that the caller of
this method will also discard any reference to this
EnhydraDirectorBufferedOutputStream object. Once
reset() has been called, this stream becomes
unusable.
flush
public void flush()
throws java.io.IOException
- Flushes outgoing data, then flushes the contained output stream.