| java.lang.Object java.io.OutputStream javax.servlet.ServletOutputStream compressionFilters.CompressionResponseStream
CompressionResponseStream | public class CompressionResponseStream extends ServletOutputStream (Code) | | Implementation of ServletOutputStream that works with
the CompressionServletResponseWrapper implementation.
author: Amy Roh author: Dmitri Valdin version: $Revision: 1.3 $, $Date: 2004/03/18 16:40:33 $ |
Field Summary | |
protected byte[] | buffer The buffer through which all of our output bytes are passed. | protected int | bufferCount The number of data bytes currently in the buffer. | protected boolean | closed | protected int | compressionThreshold The threshold number which decides to compress or not. | protected GZIPOutputStream | gzipstream The underlying gzip output stream to which we should write data. | protected int | length The content length past which we will not write, or -1 if there is
no defined content length. | protected ServletOutputStream | output The underlying servket output stream to which we should write data. | protected HttpServletResponse | response The response with which this servlet output stream is associated. |
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. | public boolean | closed() | public void | flush() Flush any buffered data for this output stream, which also causes the
response to be committed. | public void | flushToGZip() | protected void | setBuffer(int threshold) | public void | setDebugLevel(int debug) | 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. | public void | writeToGZip(byte b, int off, int len) |
buffer | protected byte[] buffer(Code) | | The buffer through which all of our output bytes are passed.
|
bufferCount | protected int bufferCount(Code) | | The number of data bytes currently in the buffer.
|
closed | protected boolean closed(Code) | | Has this stream been closed?
|
compressionThreshold | protected int compressionThreshold(Code) | | The threshold number which decides to compress or not.
Users can configure in web.xml to set it to fit their needs.
|
gzipstream | protected GZIPOutputStream gzipstream(Code) | | The underlying gzip output stream to which we should write data.
|
length | protected int length(Code) | | The content length past which we will not write, or -1 if there is
no defined content length.
|
CompressionResponseStream | public CompressionResponseStream(HttpServletResponse response) throws IOException(Code) | | Construct a servlet output stream associated with the specified Response.
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 | public 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.
|
setBuffer | protected void setBuffer(int threshold)(Code) | | Set the compressionThreshold number and create buffer for this size
|
setDebugLevel | public void setDebugLevel(int debug)(Code) | | Set debug level
|
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 |
writeToGZip | public void writeToGZip(byte b, int off, int len) throws IOException(Code) | | |
|
|