@Priority(value=4000) public class DeflateEncoder extends ContentEncoder
Content-Encoding header value equals to deflate.
The default behavior of this interceptor can be tweaked using MessageProperties.DEFLATE_WITHOUT_ZLIB
property.| Modifier and Type | Field and Description |
|---|---|
private javax.ws.rs.core.Configuration |
config |
| Constructor and Description |
|---|
DeflateEncoder(javax.ws.rs.core.Configuration config)
Initialize DeflateEncoder.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
decode(java.lang.String contentEncoding,
java.io.InputStream encodedStream)
Implementations of this method should take the encoded stream, wrap it and return a stream that can be used
to read the decoded entity.
|
java.io.OutputStream |
encode(java.lang.String contentEncoding,
java.io.OutputStream entityStream)
Implementations of this method should take the entity stream, wrap it and return a stream that is encoded
using the specified encoding.
|
aroundReadFrom, aroundWriteTo, getSupportedEncodings@Inject public DeflateEncoder(javax.ws.rs.core.Configuration config)
config - Jersey configuration properties.public java.io.InputStream decode(java.lang.String contentEncoding,
java.io.InputStream encodedStream)
throws java.io.IOException
ContentEncoderdecode in class ContentEncodercontentEncoding - Encoding to be used to decode the stream - guaranteed to be one of the supported encoding
values.encodedStream - Encoded input stream.java.io.IOException - if an IO error arises.public java.io.OutputStream encode(java.lang.String contentEncoding,
java.io.OutputStream entityStream)
throws java.io.IOException
ContentEncoderencode in class ContentEncodercontentEncoding - Encoding to be used to encode the entity - guaranteed to be one of the supported encoding
values.entityStream - Entity stream to be encoded.java.io.IOException - if an IO error arises.