Package org.eclipse.jetty.client
Interface ContentDecoder
- All Known Implementing Classes:
GZIPContentDecoder
public interface ContentDecoder
ContentDecoder
decodes content bytes of a response.- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
static class
Factory forContentDecoder
s; subclasses must implementContentDecoder.Factory.newContentDecoder()
. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
afterDecoding
(Response response) Processes the exchange after the response content has been decoded.default void
beforeDecoding
(Response response) Processes the response just before the decoding of the response content.decode
(ByteBuffer buffer) Decodes the bytes in the givenbuffer
and returns the decoded bytes.
-
Method Details
-
beforeDecoding
Processes the response 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. -
decode
Decodes the bytes in the given
buffer
and returns the decoded bytes.The returned
RetainableByteBuffer
will eventually be released viaRetainable.release()
by the code that called this method.- Parameters:
buffer
- the buffer containing encoded bytes- Returns:
- a buffer containing decoded bytes
-
afterDecoding
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.
-