Package org.glassfish.jersey.message
Class GZipEncoder
java.lang.Object
org.glassfish.jersey.spi.ContentEncoder
org.glassfish.jersey.message.GZipEncoder
- All Implemented Interfaces:
ReaderInterceptor
,WriterInterceptor
GZIP encoding support. Interceptor that encodes the output or decodes the input if
Content-Encoding header
value equals to gzip
or x-gzip
.- Author:
- Martin Matula
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondecode
(String contentEncoding, 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.encode
(String contentEncoding, 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
-
Constructor Details
-
GZipEncoder
public GZipEncoder()Initialize GZipEncoder.
-
-
Method Details
-
decode
Description copied from class:ContentEncoder
Implementations 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:
decode
in 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:
IOException
- if an IO error arises.
-
encode
Description copied from class:ContentEncoder
Implementations of this method should take the entity stream, wrap it and return a stream that is encoded using the specified encoding.- Specified by:
encode
in 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:
IOException
- if an IO error arises.
-