public class GzipOutputFilter extends Object implements OutputFilter
| Modifier and Type | Class and Description |
|---|---|
protected class |
GzipOutputFilter.FakeOutputStream |
| Modifier and Type | Field and Description |
|---|---|
protected HttpOutputBuffer |
buffer
Next buffer in the pipeline.
|
protected GZIPOutputStream |
compressionStream
Compression output stream.
|
protected OutputStream |
fakeOutputStream
Fake internal output stream.
|
protected static Log |
log |
| Constructor and Description |
|---|
GzipOutputFilter() |
| Modifier and Type | Method and Description |
|---|---|
int |
doWrite(ByteBuffer chunk)
Write the given data to the response.
|
int |
doWrite(ByteChunk chunk)
Deprecated.
Unused. Will be removed in Tomcat 9. Use
doWrite(ByteBuffer) |
void |
end()
Finish writing the current response.
|
void |
flush()
Added to allow flushing to happen for the gzip'ed outputstream
|
long |
getBytesWritten()
Bytes written to the underlying socket.
|
void |
recycle()
Make the filter ready to process the next request.
|
void |
setBuffer(HttpOutputBuffer buffer)
Set the next buffer in the filter pipeline.
|
void |
setResponse(Response response)
Some filters need additional parameters from the response.
|
protected static final Log log
protected HttpOutputBuffer buffer
protected GZIPOutputStream compressionStream
protected final OutputStream fakeOutputStream
@Deprecated public int doWrite(ByteChunk chunk) throws IOException
doWrite(ByteBuffer)OutputBufferdoWrite in interface OutputBufferchunk - data to writeIOException - an underlying I/O error occurredpublic int doWrite(ByteBuffer chunk) throws IOException
OutputBufferdoWrite in interface OutputBufferchunk - data to writeIOException - an underlying I/O error occurredpublic long getBytesWritten()
OutputBuffergetBytesWritten in interface OutputBufferpublic void flush()
throws IOException
flush in interface HttpOutputBufferIOException - If an I/O error occurs while flushingpublic void setResponse(Response response)
OutputFiltersetResponse in interface OutputFilterresponse - The response to associate with this OutputFilterpublic void setBuffer(HttpOutputBuffer buffer)
OutputFiltersetBuffer in interface OutputFilterbuffer - The next buffer instancepublic void end()
throws IOException
HttpOutputBufferOutputBuffer.doWrite(java.nio.ByteBuffer) during the execution of
this method.end in interface HttpOutputBufferIOException - If an I/O error occurs while writing to the clientpublic void recycle()
recycle in interface OutputFilterCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.