Package org.brotli.wrapper.dec
Class Decoder
- java.lang.Object
-
- org.brotli.wrapper.dec.Decoder
-
- Direct Known Subclasses:
BrotliDecoderChannel
public class Decoder extends java.lang.Object
Base class for InputStream / Channel implementations.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.nio.ByteBuffer
buffer
(package private) boolean
closed
private DecoderJNI.Wrapper
decoder
(package private) boolean
eager
private static java.nio.ByteBuffer
EMPTY_BUFFER
private java.nio.channels.ReadableByteChannel
source
-
Constructor Summary
Constructors Constructor Description Decoder(java.nio.channels.ReadableByteChannel source, int inputBufferSize)
Creates a Decoder wrapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
attachDictionary(java.nio.ByteBuffer dictionary)
(package private) void
close()
(package private) int
consume(java.nio.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
enableEagerOutput()
private void
fail(java.lang.String message)
-
-
-
Field Detail
-
EMPTY_BUFFER
private static final java.nio.ByteBuffer EMPTY_BUFFER
-
source
private final java.nio.channels.ReadableByteChannel source
-
decoder
private final DecoderJNI.Wrapper decoder
-
buffer
java.nio.ByteBuffer buffer
-
closed
boolean closed
-
eager
boolean eager
-
-
Method Detail
-
fail
private void fail(java.lang.String message) throws java.io.IOException
- Throws:
java.io.IOException
-
attachDictionary
void attachDictionary(java.nio.ByteBuffer dictionary) throws java.io.IOException
- Throws:
java.io.IOException
-
enableEagerOutput
public void enableEagerOutput()
-
decode
int decode() throws java.io.IOException
Continue decoding.- Returns:
- -1 if stream is finished, or number of bytes available in read buffer (> 0)
- Throws:
java.io.IOException
-
discard
void discard(int length)
-
consume
int consume(java.nio.ByteBuffer dst)
-
close
void close() throws java.io.IOException
- Throws:
java.io.IOException
-
decompress
public static byte[] decompress(byte[] data) throws java.io.IOException
Decodes the given data buffer.- Throws:
java.io.IOException
-
-