Class GZIPContentDecoder
- All Implemented Interfaces:
ContentDecoder
,Destroyable
ContentDecoder
for the "gzip" encoding.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
SpecializedContentDecoder.Factory
for the "gzip" encoding. -
Field Summary
-
Constructor Summary
ConstructorDescriptionGZIPContentDecoder
(int bufferSize) GZIPContentDecoder
(ByteBufferPool byteBufferPool, int bufferSize) -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterDecoding
(HttpExchange exchange) Processes the exchange after the response content has been decoded.void
beforeDecoding
(HttpExchange exchange) Processes the exchange just before the decoding of the response content.protected boolean
decodedChunk
(ByteBuffer chunk) Called when a chunk of data is inflated.Methods inherited from class org.eclipse.jetty.http.GZIPContentDecoder
acquire, decode, decodeChunks, destroy, isFinished, release
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.client.ContentDecoder
decode, release
-
Field Details
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZE- See Also:
-
-
Constructor Details
-
GZIPContentDecoder
public GZIPContentDecoder() -
GZIPContentDecoder
public GZIPContentDecoder(int bufferSize) -
GZIPContentDecoder
-
-
Method Details
-
beforeDecoding
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 theContent-Encoding
header.- Specified by:
beforeDecoding
in interfaceContentDecoder
- Parameters:
exchange
- the exchange to process before decoding the response content
-
decodedChunk
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 toGZIPContentDecoder.decode(ByteBuffer)
orGZIPContentDecoder.decodeChunks(ByteBuffer)
is made.- Overrides:
decodedChunk
in classGZIPContentDecoder
- Parameters:
chunk
- the inflated chunk of data- Returns:
- false if inflating should continue, or true if the call
to
GZIPContentDecoder.decodeChunks(ByteBuffer)
orGZIPContentDecoder.decode(ByteBuffer)
should return, allowing to consume the inflated chunk and apply backpressure
-
afterDecoding
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 interfaceContentDecoder
- Parameters:
exchange
- the exchange to process after decoding the response content
-