Package org.brotli.wrapper.dec
Class BrotliDecoderChannel
- java.lang.Object
-
- org.brotli.wrapper.dec.Decoder
-
- org.brotli.wrapper.dec.BrotliDecoderChannel
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.nio.channels.Channel
,java.nio.channels.ReadableByteChannel
public class BrotliDecoderChannel extends Decoder implements java.nio.channels.ReadableByteChannel
ReadableByteChannel that wraps native brotli decoder.
-
-
Constructor Summary
Constructors Constructor Description BrotliDecoderChannel(java.nio.channels.ReadableByteChannel source)
BrotliDecoderChannel(java.nio.channels.ReadableByteChannel source, int bufferSize)
Creates a BrotliDecoderChannel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attachDictionary(java.nio.ByteBuffer dictionary)
void
close()
boolean
isOpen()
int
read(java.nio.ByteBuffer dst)
-
Methods inherited from class org.brotli.wrapper.dec.Decoder
consume, decode, decompress, discard, enableEagerOutput
-
-
-
-
Field Detail
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZE
The default internal buffer size used by the decoder.- See Also:
- Constant Field Values
-
mutex
private final java.lang.Object mutex
-
-
Constructor Detail
-
BrotliDecoderChannel
public BrotliDecoderChannel(java.nio.channels.ReadableByteChannel source, int bufferSize) throws java.io.IOException
Creates a BrotliDecoderChannel.- Parameters:
source
- underlying sourcebufferSize
- intermediate buffer sizecustomDictionary
- initial LZ77 dictionary- Throws:
java.io.IOException
-
BrotliDecoderChannel
public BrotliDecoderChannel(java.nio.channels.ReadableByteChannel source) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
attachDictionary
public void attachDictionary(java.nio.ByteBuffer dictionary) throws java.io.IOException
- Overrides:
attachDictionary
in classDecoder
- Throws:
java.io.IOException
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interfacejava.nio.channels.Channel
-
close
public void close() throws java.io.IOException
-
read
public int read(java.nio.ByteBuffer dst) throws java.io.IOException
- Specified by:
read
in interfacejava.nio.channels.ReadableByteChannel
- Throws:
java.io.IOException
-
-