Package org.glassfish.jersey.message
Class DeflateEncoder
- java.lang.Object
-
- org.glassfish.jersey.spi.ContentEncoder
-
- org.glassfish.jersey.message.DeflateEncoder
-
- All Implemented Interfaces:
javax.ws.rs.ext.ReaderInterceptor,javax.ws.rs.ext.WriterInterceptor
@Priority(4000) public class DeflateEncoder extends ContentEncoder
Deflate encoding support. Interceptor that encodes the output or decodes the input ifContent-Encoding headervalue equals todeflate. The default behavior of this interceptor can be tweaked usingMessageProperties.DEFLATE_WITHOUT_ZLIBproperty.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.ws.rs.core.Configurationconfig
-
Constructor Summary
Constructors Constructor Description DeflateEncoder(javax.ws.rs.core.Configuration config)Initialize DeflateEncoder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamdecode(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.OutputStreamencode(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.-
Methods inherited from class org.glassfish.jersey.spi.ContentEncoder
aroundReadFrom, aroundWriteTo, getSupportedEncodings
-
-
-
-
Method Detail
-
decode
public java.io.InputStream decode(java.lang.String contentEncoding, java.io.InputStream encodedStream) throws java.io.IOExceptionDescription copied from class:ContentEncoderImplementations of this method should take the encoded stream, wrap it and return a stream that can be used to read the decoded entity.- Specified by:
decodein classContentEncoder- Parameters:
contentEncoding- Encoding to be used to decode the stream - guaranteed to be one of the supported encoding values.encodedStream- Encoded input stream.- Returns:
- Decoded entity stream.
- Throws:
java.io.IOException- if an IO error arises.
-
encode
public java.io.OutputStream encode(java.lang.String contentEncoding, java.io.OutputStream entityStream) throws java.io.IOExceptionDescription copied from class:ContentEncoderImplementations of this method should take the entity stream, wrap it and return a stream that is encoded using the specified encoding.- Specified by:
encodein classContentEncoder- Parameters:
contentEncoding- Encoding to be used to encode the entity - guaranteed to be one of the supported encoding values.entityStream- Entity stream to be encoded.- Returns:
- Encoded stream.
- Throws:
java.io.IOException- if an IO error arises.
-
-