Package de.hybris.platform.util
Class GZIPResponseStream
java.lang.Object
java.io.OutputStream
javax.servlet.ServletOutputStream
de.hybris.platform.util.GZIPResponseStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class GZIPResponseStream
extends javax.servlet.ServletOutputStream
This is an implementation of a ServletOutputStream which uses a GZIPOutputStream to provide gzip compression for a
HttpServletResponse (see
GZIPResponseWrapper).-
Constructor Summary
ConstructorsConstructorDescriptionGZIPResponseStream(javax.servlet.http.HttpServletResponse response, boolean captureText) Creates a new GZIPOutputStream which is an implementation of a ServletOutputStream which uses a GZIPOutputStream to provide gzip compression for a HttpServletResponse (seeGZIPResponseWrapper). -
Method Summary
Modifier and TypeMethodDescriptionprotected StringapplyRegExp(StringBuilder complete) voidclose()Closes this stream (which implies finishing the underlying GZIPOutputStream, adding correct response headers and flushing/closing the outputstream).booleanclosed()Returns true if this stream has been closed (usingclose()).protected booleanvoidflush()Flushes this stream (and thus flushes the underlying GZIPOutputStream).booleanisReady()voidsetWriteListener(javax.servlet.WriteListener writeListener) voidwrite(byte[] b) Writes the given byte array to this stream (and thus to the underlying GZIPOutputStream).voidwrite(byte[] b, int off, int len) Writes the given byte array to this stream (and thus to the underlying GZIPOutputStream).voidwrite(int b) Writes the given byte to this stream (and thus to the underlying GZIPOutputStream).Methods inherited from class javax.servlet.ServletOutputStream
print, print, print, print, print, print, print, println, println, println, println, println, println, println, printlnMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
GZIPResponseStream
public GZIPResponseStream(javax.servlet.http.HttpServletResponse response, boolean captureText) throws IOException Creates a new GZIPOutputStream which is an implementation of a ServletOutputStream which uses a GZIPOutputStream to provide gzip compression for a HttpServletResponse (seeGZIPResponseWrapper).- Throws:
IOException
-
-
Method Details
-
filterOutput
protected boolean filterOutput() -
flush
Flushes this stream (and thus flushes the underlying GZIPOutputStream).- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
Closes this stream (which implies finishing the underlying GZIPOutputStream, adding correct response headers and flushing/closing the outputstream).- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
applyRegExp
-
closed
public boolean closed()Returns true if this stream has been closed (usingclose()).- Returns:
- true if this stream has been closed
-
write
Writes the given byte to this stream (and thus to the underlying GZIPOutputStream).- Specified by:
writein classOutputStream- Throws:
IOException
-
write
Writes the given byte array to this stream (and thus to the underlying GZIPOutputStream).- Overrides:
writein classOutputStream- Throws:
IOException
-
write
Writes the given byte array to this stream (and thus to the underlying GZIPOutputStream).- Overrides:
writein classOutputStream- Throws:
IOException
-
isReady
public boolean isReady()- Specified by:
isReadyin classjavax.servlet.ServletOutputStream
-
setWriteListener
public void setWriteListener(javax.servlet.WriteListener writeListener) - Specified by:
setWriteListenerin classjavax.servlet.ServletOutputStream
-