public abstract class AbstractCompressedStream
extends javax.servlet.ServletOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected ByteArrayOutputStream2 |
_bOut |
protected boolean |
_closed |
protected DeflaterOutputStream |
_compressedOutputStream |
protected boolean |
_doNotCompress |
protected OutputStream |
_out |
protected javax.servlet.http.HttpServletResponse |
_response |
protected String |
_vary |
protected CompressedResponseWrapper |
_wrapper |
| Constructor and Description |
|---|
AbstractCompressedStream(String encoding,
javax.servlet.http.HttpServletRequest request,
CompressedResponseWrapper wrapper,
String vary)
Instantiates a new compressed stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract DeflaterOutputStream |
createStream()
Create the stream fitting to the underlying compression type.
|
void |
doCompress()
Do compress.
|
void |
doNotCompress(boolean sendVary)
Do not compress.
|
void |
finish()
Finish.
|
void |
flush() |
OutputStream |
getOutputStream() |
boolean |
isClosed() |
protected PrintWriter |
newWriter(OutputStream out,
String encoding)
Allows derived implementations to replace PrintWriter implementation.
|
void |
resetBuffer()
Reset buffer.
|
void |
setContentLength() |
protected void |
setHeader(String name,
String value) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
protected final String _vary
protected final CompressedResponseWrapper _wrapper
protected final javax.servlet.http.HttpServletResponse _response
protected OutputStream _out
protected ByteArrayOutputStream2 _bOut
protected DeflaterOutputStream _compressedOutputStream
protected boolean _closed
protected boolean _doNotCompress
public AbstractCompressedStream(String encoding, javax.servlet.http.HttpServletRequest request, CompressedResponseWrapper wrapper, String vary) throws IOException
IOExceptionpublic void resetBuffer()
public void setContentLength()
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionOutputStream.flush()public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionOutputStream.close()public void finish()
throws IOException
IOException - Signals that an I/O exception has occurred.public void write(int b)
throws IOException
write in class OutputStreamIOExceptionOutputStream.write(int)public void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionOutputStream.write(byte[])public void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionOutputStream.write(byte[], int, int)public void doCompress()
throws IOException
IOException - Signals that an I/O exception has occurred.public void doNotCompress(boolean sendVary)
throws IOException
IOException - Signals that an I/O exception has occurred.public OutputStream getOutputStream()
CompressedStreampublic boolean isClosed()
CompressedStreamprotected PrintWriter newWriter(OutputStream out, String encoding) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected abstract DeflaterOutputStream createStream() throws IOException
IOException - Signals that an I/O exception has occurred.Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.