Class GZIPContentDecoder

java.lang.Object
org.eclipse.jetty.http.GZIPContentDecoder
org.eclipse.jetty.client.GZIPContentDecoder
All Implemented Interfaces:
ContentDecoder, Destroyable

public class GZIPContentDecoder extends GZIPContentDecoder implements ContentDecoder
ContentDecoder for the "gzip" encoding.
  • Field Details

  • Constructor Details

    • GZIPContentDecoder

      public GZIPContentDecoder()
    • GZIPContentDecoder

      public GZIPContentDecoder(int bufferSize)
    • GZIPContentDecoder

      public GZIPContentDecoder(ByteBufferPool byteBufferPool, int bufferSize)
  • Method Details

    • beforeDecoding

      public void beforeDecoding(HttpExchange exchange)
      Description copied from interface: ContentDecoder

      Processes the exchange just before the decoding of the response content.

      Typical processing may involve modifying the response headers, for example by temporarily removing the Content-Length header, or modifying the Content-Encoding header.

      Specified by:
      beforeDecoding in interface ContentDecoder
      Parameters:
      exchange - the exchange to process before decoding the response content
    • decodedChunk

      protected boolean decodedChunk(ByteBuffer chunk)
      Description copied from class: GZIPContentDecoder

      Called when a chunk of data is inflated.

      The default implementation aggregates all the chunks into a single buffer returned from GZIPContentDecoder.decode(ByteBuffer).

      Derived implementations may choose to consume inflated chunks individually and return true from this method to prevent further inflation until a subsequent call to GZIPContentDecoder.decode(ByteBuffer) or GZIPContentDecoder.decodeChunks(ByteBuffer) is made.

      Overrides:
      decodedChunk in class GZIPContentDecoder
      Parameters:
      chunk - the inflated chunk of data
      Returns:
      false if inflating should continue, or true if the call to GZIPContentDecoder.decodeChunks(ByteBuffer) or GZIPContentDecoder.decode(ByteBuffer) should return, allowing to consume the inflated chunk and apply backpressure
    • afterDecoding

      public void afterDecoding(HttpExchange exchange)
      Description copied from interface: ContentDecoder

      Processes the exchange after the response content has been decoded.

      Typical processing may involve modifying the response headers, for example updating the Content-Length header to the length of the decoded response content.

      Specified by:
      afterDecoding in interface ContentDecoder
      Parameters:
      exchange - the exchange to process after decoding the response content