Package org.apache.juneau.encoders
Class Encoder
java.lang.Object
org.apache.juneau.encoders.Encoder
- Direct Known Subclasses:
EncoderSet.Inherit
,EncoderSet.NoInherit
,GzipEncoder
,IdentityEncoder
Used for enabling decompression on requests and compression on responses, such as support for GZIP compression.
Description
Used to wrap input and output streams within compression/decompression streams.
Encoders are registered with
Notes:
- This class is thread safe and reusable.
See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String[]
Returns the codings inContent-Encoding andAccept-Encoding headers that this encoder handles (e.g.abstract InputStream
Converts the specified compressed input stream into an uncompressed stream.abstract OutputStream
Converts the specified uncompressed output stream into an uncompressed stream.
-
Constructor Details
-
Encoder
public Encoder()
-
-
Method Details
-
getInputStream
Converts the specified compressed input stream into an uncompressed stream.- Parameters:
is
- The compressed stream.- Returns:
- The uncompressed stream.
- Throws:
IOException
- If any errors occur, such as on a stream that's not a valid GZIP input stream.
-
getOutputStream
Converts the specified uncompressed output stream into an uncompressed stream.- Parameters:
os
- The uncompressed stream.- Returns:
- The compressed stream stream.
- Throws:
IOException
- If any errors occur.
-
getCodings
Returns the codings inContent-Encoding andAccept-Encoding headers that this encoder handles (e.g."gzip" ).- Returns:
- The codings that this encoder handles.
-