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.ObjectBase class for InputStream / Channel implementations.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.nio.ByteBufferbuffer(package private) booleanclosedprivate DecoderJNI.Wrapperdecoder(package private) booleaneagerprivate static java.nio.ByteBufferEMPTY_BUFFERprivate java.nio.channels.ReadableByteChannelsource
-
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) voidattachDictionary(java.nio.ByteBuffer dictionary)(package private) voidclose()(package private) intconsume(java.nio.ByteBuffer dst)(package private) intdecode()Continue decoding.static byte[]decompress(byte[] data)Decodes the given data buffer.(package private) voiddiscard(int length)voidenableEagerOutput()private voidfail(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.IOExceptionContinue 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.IOExceptionDecodes the given data buffer.- Throws:
java.io.IOException
-
-