org.eclipse.jetty.http.gzip

## Class CompressedResponseWrapper

- java.lang.Object
- - javax.servlet.ServletResponseWrapper
  - - javax.servlet.http.HttpServletResponseWrapper
    - - org.eclipse.jetty.http.gzip.CompressedResponseWrapper

All Implemented Interfaces:
  javax.servlet.http.HttpServletResponse, javax.servlet.ServletResponse

    public abstract class CompressedResponseWrapper
    extends javax.servlet.http.HttpServletResponseWrapper

### Field Summary

Fields
`protected javax.servlet.http.HttpServletRequest` `_request`
`static int` `DEFAULT_BUFFER_SIZE`
`static int` `DEFAULT_MIN_COMPRESS_SIZE`

### Fields inherited from interface javax.servlet.http.HttpServletResponse

`SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY`

### Constructor Summary

Constructors
Constructor and Description
`CompressedResponseWrapper(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`

### Method Summary

Methods
`void` `addHeader(String name, String value)`
`boolean` `containsHeader(String name)`
`void` `finish()`
`void` `flushBuffer()`
`int` `getBufferSize()`
`long` `getContentLength()`
`String` `getETag()`
`int` `getMinCompressSize()`
`javax.servlet.ServletOutputStream` `getOutputStream()`
`javax.servlet.http.HttpServletRequest` `getRequest()`
`PrintWriter` `getWriter()`
`protected abstract AbstractCompressedStream` `newCompressedStream(javax.servlet.http.HttpServletRequest _request, javax.servlet.http.HttpServletResponse response)`
`protected PrintWriter` `newWriter(OutputStream out, String encoding)` Allows derived implementations to replace PrintWriter implementation.
`void` `noCompression()`
`void` `reset()`
`void` `resetBuffer()`
`void` `sendError(int sc)`
`void` `sendError(int sc, String msg)`
`void` `sendRedirect(String location)`
`void` `setBufferSize(int bufferSize)`
`void` `setContentLength(int length)`
`protected void` `setContentLength(long length)`
`void` `setContentType(String ct)`
`void` `setHeader(String name, String value)`
`void` `setIntHeader(String name, int value)`
`void` `setMimeTypes(Set<String> mimeTypes)`
`void` `setMinCompressSize(int minCompressSize)`
`void` `setStatus(int sc)`
`void` `setStatus(int sc, String sm)`

### Methods inherited from class javax.servlet.http.HttpServletResponseWrapper

`addCookie, addDateHeader, addIntHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, getHeader, getHeaderNames, getHeaders, getStatus, setDateHeader`

### Methods inherited from class javax.servlet.ServletResponseWrapper

`getCharacterEncoding, getContentType, getLocale, getResponse, isCommitted, isWrapperFor, isWrapperFor, setCharacterEncoding, setLocale, setResponse`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface javax.servlet.ServletResponse

`getCharacterEncoding, getContentType, getLocale, isCommitted, setCharacterEncoding, setLocale`

### Field Detail

#### DEFAULT_BUFFER_SIZE

    public static final int DEFAULT_BUFFER_SIZE

See Also:
  Constant Field Values

#### DEFAULT_MIN_COMPRESS_SIZE

    public static final int DEFAULT_MIN_COMPRESS_SIZE

See Also:
  Constant Field Values

#### _request

    protected javax.servlet.http.HttpServletRequest _request

### Constructor Detail

#### CompressedResponseWrapper

    public CompressedResponseWrapper(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)

### Method Detail

#### getContentLength

    public long getContentLength()

#### getBufferSize

    public int getBufferSize()

Specified by:
  `getBufferSize` in interface `javax.servlet.ServletResponse`
Overrides:
  `getBufferSize` in class `javax.servlet.ServletResponseWrapper`

#### getMinCompressSize

    public int getMinCompressSize()

#### getETag

    public String getETag()

#### getRequest

    public javax.servlet.http.HttpServletRequest getRequest()

#### setMimeTypes

    public void setMimeTypes(Set<String> mimeTypes)

See Also:
  `setMimeTypes(java.util.Set)`

#### setBufferSize

    public void setBufferSize(int bufferSize)

Specified by:
  `setBufferSize` in interface `javax.servlet.ServletResponse`
Overrides:
  `setBufferSize` in class `javax.servlet.ServletResponseWrapper`
See Also:
  `setBufferSize(int)`

#### setMinCompressSize

    public void setMinCompressSize(int minCompressSize)

See Also:
  `setMinCompressSize(int)`

#### setContentType

    public void setContentType(String ct)

Specified by:
  `setContentType` in interface `javax.servlet.ServletResponse`
Overrides:
  `setContentType` in class `javax.servlet.ServletResponseWrapper`
See Also:
  `setContentType(java.lang.String)`

#### setStatus

    public void setStatus(int sc,
                 String sm)

Specified by:
  `setStatus` in interface `javax.servlet.http.HttpServletResponse`
Overrides:
  `setStatus` in class `javax.servlet.http.HttpServletResponseWrapper`
See Also:
  `setStatus(int, java.lang.String)`

#### setStatus

    public void setStatus(int sc)

Specified by:
  `setStatus` in interface `javax.servlet.http.HttpServletResponse`
Overrides:
  `setStatus` in class `javax.servlet.http.HttpServletResponseWrapper`
See Also:
  `setStatus(int)`

#### setContentLength

    public void setContentLength(int length)

Specified by:
  `setContentLength` in interface `javax.servlet.ServletResponse`
Overrides:
  `setContentLength` in class `javax.servlet.ServletResponseWrapper`
See Also:
  `setContentLength(int)`

#### setContentLength

    protected void setContentLength(long length)

#### addHeader

    public void addHeader(String name,
                 String value)

Specified by:
  `addHeader` in interface `javax.servlet.http.HttpServletResponse`
Overrides:
  `addHeader` in class `javax.servlet.http.HttpServletResponseWrapper`
See Also:
  `addHeader(java.lang.String, java.lang.String)`

#### flushBuffer

    public void flushBuffer()
                     throws IOException

Specified by:
  `flushBuffer` in interface `javax.servlet.ServletResponse`
Overrides:
  `flushBuffer` in class `javax.servlet.ServletResponseWrapper`
Throws:
  `IOException`
See Also:
  `flushBuffer()`

#### reset

    public void reset()

Specified by:
  `reset` in interface `javax.servlet.ServletResponse`
Overrides:
  `reset` in class `javax.servlet.ServletResponseWrapper`
See Also:
  `reset()`

#### resetBuffer

    public void resetBuffer()

Specified by:
  `resetBuffer` in interface `javax.servlet.ServletResponse`
Overrides:
  `resetBuffer` in class `javax.servlet.ServletResponseWrapper`
See Also:
  `resetBuffer()`

#### sendError

    public void sendError(int sc,
                 String msg)
                   throws IOException

Specified by:
  `sendError` in interface `javax.servlet.http.HttpServletResponse`
Overrides:
  `sendError` in class `javax.servlet.http.HttpServletResponseWrapper`
Throws:
  `IOException`
See Also:
  `sendError(int, java.lang.String)`

#### sendError

    public void sendError(int sc)
                   throws IOException

Specified by:
  `sendError` in interface `javax.servlet.http.HttpServletResponse`
Overrides:
  `sendError` in class `javax.servlet.http.HttpServletResponseWrapper`
Throws:
  `IOException`
See Also:
  `sendError(int)`

#### sendRedirect

    public void sendRedirect(String location)
                      throws IOException

Specified by:
  `sendRedirect` in interface `javax.servlet.http.HttpServletResponse`
Overrides:
  `sendRedirect` in class `javax.servlet.http.HttpServletResponseWrapper`
Throws:
  `IOException`
See Also:
  `sendRedirect(java.lang.String)`

#### noCompression

    public void noCompression()

See Also:
  `noCompression()`

#### finish

    public void finish()
                throws IOException

Throws:
  `IOException`
See Also:
  `finish()`

#### setHeader

    public void setHeader(String name,
                 String value)

Specified by:
  `setHeader` in interface `javax.servlet.http.HttpServletResponse`
Overrides:
  `setHeader` in class `javax.servlet.http.HttpServletResponseWrapper`
See Also:
  `setHeader(java.lang.String, java.lang.String)`

#### containsHeader

    public boolean containsHeader(String name)

Specified by:
  `containsHeader` in interface `javax.servlet.http.HttpServletResponse`
Overrides:
  `containsHeader` in class `javax.servlet.http.HttpServletResponseWrapper`

#### getOutputStream

    public javax.servlet.ServletOutputStream getOutputStream()
                                                      throws IOException

Specified by:
  `getOutputStream` in interface `javax.servlet.ServletResponse`
Overrides:
  `getOutputStream` in class `javax.servlet.ServletResponseWrapper`
Throws:
  `IOException`
See Also:
  `getOutputStream()`

#### getWriter

    public PrintWriter getWriter()
                          throws IOException

Specified by:
  `getWriter` in interface `javax.servlet.ServletResponse`
Overrides:
  `getWriter` in class `javax.servlet.ServletResponseWrapper`
Throws:
  `IOException`
See Also:
  `getWriter()`

#### setIntHeader

    public void setIntHeader(String name,
                    int value)

Specified by:
  `setIntHeader` in interface `javax.servlet.http.HttpServletResponse`
Overrides:
  `setIntHeader` in class `javax.servlet.http.HttpServletResponseWrapper`
See Also:
  `setIntHeader(java.lang.String, int)`

#### newWriter

    protected PrintWriter newWriter(OutputStream out,
                        String encoding)
                             throws UnsupportedEncodingException

Allows derived implementations to replace PrintWriter implementation.

Parameters:
  `out` - the out
  `encoding` - the encoding
Returns:
  the prints the writer
Throws:
  `UnsupportedEncodingException` - the unsupported encoding exception

#### newCompressedStream

    protected abstract AbstractCompressedStream newCompressedStream(javax.servlet.http.HttpServletRequest _request,
                                               javax.servlet.http.HttpServletResponse response)
                                                             throws IOException

Returns:
  the underlying CompressedStream implementation
Throws:
  `IOException`