- All Superinterfaces:
AutoCloseable
An object that decompresses
ByteBuffer
chunks of a compressed stream in a non-blocking
manner. An AsyncDecoder
is used with a AsyncBodyDecoder
to craft an
implementation of the BodyDecoder
interface.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A sink of bytes for writing the decompressed stream asByteBuffer
chunks.static interface
A source of bytes for reading the compressed stream asByteBuffer
chunks. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Releases any resources associated with the decoder.void
decode
(AsyncDecoder.ByteSource source, AsyncDecoder.ByteSink sink) Processes whatever data available from the given source, writing decompressed bytes to the given sink.encoding()
Returns this decoder's encoding.
-
Method Details
-
encoding
String encoding()Returns this decoder's encoding. -
decode
Processes whatever data available from the given source, writing decompressed bytes to the given sink.- Parameters:
source
- the source of compressed bytessink
- the sink of decompressed bytes- Throws:
IOException
- if an error occurs while decoding
-
close
void close()Releases any resources associated with the decoder. Must be idempotent and thread safe.- Specified by:
close
in interfaceAutoCloseable
-