Package org.brotli.wrapper.dec
Class Decoder
java.lang.Object
org.brotli.wrapper.dec.Decoder
- Direct Known Subclasses:
BrotliDecoderChannel
Base class for InputStream / Channel implementations.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ByteBuffer
(package private) boolean
private final DecoderJNI.Wrapper
(package private) boolean
private static final ByteBuffer
private final ReadableByteChannel
-
Constructor Summary
ConstructorsConstructorDescriptionDecoder
(ReadableByteChannel source, int inputBufferSize) Creates a Decoder wrapper. -
Method Summary
Modifier and TypeMethodDescription(package private) void
attachDictionary
(ByteBuffer dictionary) (package private) void
close()
(package private) int
consume
(ByteBuffer dst) (package private) int
decode()
Continue decoding.static byte[]
decompress
(byte[] data) Decodes the given data buffer.(package private) void
discard
(int length) void
private void
-
Field Details
-
EMPTY_BUFFER
-
source
-
decoder
-
buffer
ByteBuffer buffer -
closed
boolean closed -
eager
boolean eager
-
-
Constructor Details
-
Decoder
Creates a Decoder wrapper.- Parameters:
source
- underlying sourceinputBufferSize
- read buffer size- Throws:
IOException
-
-
Method Details
-
fail
- Throws:
IOException
-
attachDictionary
- Throws:
IOException
-
enableEagerOutput
public void enableEagerOutput() -
decode
Continue decoding.- Returns:
- -1 if stream is finished, or number of bytes available in read buffer (> 0)
- Throws:
IOException
-
discard
void discard(int length) -
consume
-
close
- Throws:
IOException
-
decompress
Decodes the given data buffer.- Throws:
IOException
-