public abstract class AbstractCompressedStream extends ServletOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected ByteArrayOutputStream2 |
_bOut |
protected boolean |
_closed |
protected OutputStream |
_compressedOutputStream |
protected boolean |
_doNotCompress |
protected OutputStream |
_out |
protected HttpServletResponse |
_response |
protected String |
_vary |
protected CompressedResponseWrapper |
_wrapper |
| Constructor and Description |
|---|
AbstractCompressedStream(String encoding,
HttpServletRequest request,
CompressedResponseWrapper wrapper,
String vary)
Instantiates a new compressed stream.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addHeader(String name,
String value) |
void |
close() |
protected abstract OutputStream |
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() |
boolean |
isReady() |
protected PrintWriter |
newWriter(OutputStream out,
String encoding)
Allows derived implementations to replace PrintWriter implementation.
|
void |
resetBuffer()
Reset buffer.
|
void |
setBufferSize(int bufferSize) |
void |
setContentLength() |
protected void |
setHeader(String name,
String value) |
void |
setWriteListener(WriteListener writeListener) |
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 HttpServletResponse _response
protected OutputStream _out
protected ByteArrayOutputStream2 _bOut
protected OutputStream _compressedOutputStream
protected boolean _closed
protected boolean _doNotCompress
public AbstractCompressedStream(String encoding, HttpServletRequest request, CompressedResponseWrapper wrapper, String vary) throws IOException
IOExceptionpublic void resetBuffer()
public void setBufferSize(int bufferSize)
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()
public boolean isClosed()
protected PrintWriter newWriter(OutputStream out, String encoding) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic void setWriteListener(WriteListener writeListener)
setWriteListener in class ServletOutputStreampublic boolean isReady()
isReady in class ServletOutputStreamprotected abstract OutputStream createStream() throws IOException
IOException - Signals that an I/O exception has occurred.Copyright © 1995-2015 Webtide. All Rights Reserved.