| java.lang.Object java.io.OutputStream javax.servlet.ServletOutputStream org.apache.catalina.connector.ResponseStream
All known Subclasses: org.apache.catalina.connector.http.HttpResponseStream,
ResponseStream | public class ResponseStream extends ServletOutputStream (Code) | | Convenience implementation of ServletOutputStream that works with
the standard ResponseBase implementation of Response. If the content
length has been set on our associated Response, this implementation will
enforce not writing more than that many bytes on the underlying stream.
author: Craig R. McClanahan version: $Revision: 1.6 $ $Date: 2002/03/18 07:15:39 $ |
Field Summary | |
protected boolean | closed | protected boolean | commit | protected int | count The number of bytes which have already been written to this stream. | protected int | length The content length past which we will not write, or -1 if there is
no defined content length. | protected Response | response The Response with which this input stream is associated. | protected static StringManager | sm The localized strings for this package. | protected OutputStream | stream The underlying output stream to which we should write data. | protected boolean | suspended |
Constructor Summary | |
public | ResponseStream(Response response) Construct a servlet output stream associated with the specified Request. |
Method Summary | |
public void | close() Close this output stream, causing any buffered data to be flushed and
any further output data to throw an IOException. | boolean | closed() | public void | flush() Flush any buffered data for this output stream, which also causes the
response to be committed. | boolean | getCommit() [Package Private] Return the "commit response on flush" flag. | boolean | isSuspended() Suspended flag accessor. | void | reset() Reset the count of bytes written to this stream to zero. | void | setCommit(boolean commit) [Package Private] Set the "commit response on flush" flag. | void | setSuspended(boolean suspended) Set the suspended flag. | public void | write(int b) Write the specified byte to our output stream. | public void | write(byte b) Write b.length bytes from the specified byte array
to our output stream. | public void | write(byte b, int off, int len) Write len bytes from the specified byte array, starting
at the specified offset, to our output stream. |
closed | protected boolean closed(Code) | | Has this stream been closed?
|
commit | protected boolean commit(Code) | | Should we commit the response when we are flushed?
|
count | protected int count(Code) | | The number of bytes which have already been written to this stream.
|
length | protected int length(Code) | | The content length past which we will not write, or -1 if there is
no defined content length.
|
response | protected Response response(Code) | | The Response with which this input stream is associated.
|
stream | protected OutputStream stream(Code) | | The underlying output stream to which we should write data.
|
suspended | protected boolean suspended(Code) | | Has this response output been suspended?
|
ResponseStream | public ResponseStream(Response response)(Code) | | Construct a servlet output stream associated with the specified Request.
Parameters: response - The associated response |
close | public void close() throws IOException(Code) | | Close this output stream, causing any buffered data to be flushed and
any further output data to throw an IOException.
|
closed | boolean closed()(Code) | | Has this response stream been closed?
|
flush | public void flush() throws IOException(Code) | | Flush any buffered data for this output stream, which also causes the
response to be committed.
|
getCommit | boolean getCommit()(Code) | | [Package Private] Return the "commit response on flush" flag.
|
isSuspended | boolean isSuspended()(Code) | | Suspended flag accessor.
|
reset | void reset()(Code) | | Reset the count of bytes written to this stream to zero.
|
setCommit | void setCommit(boolean commit)(Code) | | [Package Private] Set the "commit response on flush" flag.
Parameters: commit - The new commit flag |
setSuspended | void setSuspended(boolean suspended)(Code) | | Set the suspended flag.
|
write | public void write(int b) throws IOException(Code) | | Write the specified byte to our output stream.
Parameters: b - The byte to be written exception: IOException - if an input/output error occurs |
write | public void write(byte b) throws IOException(Code) | | Write b.length bytes from the specified byte array
to our output stream.
Parameters: b - The byte array to be written exception: IOException - if an input/output error occurs |
write | public void write(byte b, int off, int len) throws IOException(Code) | | Write len bytes from the specified byte array, starting
at the specified offset, to our output stream.
Parameters: b - The byte array containing the bytes to be written Parameters: off - Zero-relative starting offset of the bytes to be written Parameters: len - The number of bytes to be written exception: IOException - if an input/output error occurs |
|
|