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
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFactory forContentDecoders; subclasses must implementContentDecoder.Factory.newContentDecoder(). -
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterDecoding(HttpExchange exchange) Processes the exchange after the response content has been decoded.default voidbeforeDecoding(HttpExchange exchange) Processes the exchange just before the decoding of the response content.decode(ByteBuffer buffer) Decodes the bytes in the givenbufferand returns decoded bytes, if any.default voidrelease(ByteBuffer decoded) Releases the ByteBuffer returned bydecode(ByteBuffer).
-
Method Details
-
beforeDecoding
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-Lengthheader, or modifying theContent-Encodingheader.- Parameters:
exchange- the exchange to process before decoding the response content
-
decode
Decodes the bytes in the given
bufferand returns decoded bytes, if any.- Parameters:
buffer- the buffer containing encoded bytes- Returns:
- a buffer containing decoded bytes, if any
-
release
Releases the ByteBuffer returned by
decode(ByteBuffer).- Parameters:
decoded- the ByteBuffer returned bydecode(ByteBuffer)
-
afterDecoding
Processes the exchange after the response content has been decoded.
Typical processing may involve modifying the response headers, for example updating the
Content-Lengthheader to the length of the decoded response content.- Parameters:
exchange- the exchange to process after decoding the response content
-