-
- All Superinterfaces:
java.lang.AutoCloseable
public interface AsyncDecoder extends java.lang.AutoCloseableAn object that decompressesByteBufferchunks of a compressed stream in a non-blocking manner. AnAsyncDecoderis used with aAsyncBodyDecoderto craft an implementation of theBodyDecoderinterface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAsyncDecoder.ByteSinkA sink of bytes for writing the decompressed stream asByteBufferchunks.static interfaceAsyncDecoder.ByteSourceA source of bytes for reading the compressed stream asByteBufferchunks.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()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.java.lang.Stringencoding()Returns this decoder's encoding.
-
-
-
Method Detail
-
encoding
java.lang.String encoding()
Returns this decoder's encoding.
-
decode
void decode(AsyncDecoder.ByteSource source, AsyncDecoder.ByteSink sink) throws java.io.IOException
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:
java.io.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 interfacejava.lang.AutoCloseable
-
-