Interface AsyncDecoder
- 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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA sink of bytes for writing the decompressed stream asByteBufferchunks.static interfaceA source of bytes for reading the compressed stream asByteBufferchunks. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases any resources associated with the decoder.voiddecode(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:
closein interfaceAutoCloseable
-