Package org.brotli.wrapper.dec
Class BrotliInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.brotli.wrapper.dec.BrotliInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class BrotliInputStream extends java.io.InputStreamInputStream that wraps native brotli decoder.
-
-
Field Summary
Fields Modifier and Type Field Description private Decoderdecoderprivate static intDEFAULT_BUFFER_SIZEThe default internal buffer size used by the decoder.
-
Constructor Summary
Constructors Constructor Description BrotliInputStream(java.io.InputStream source)BrotliInputStream(java.io.InputStream source, int bufferSize)Creates a BrotliInputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachDictionary(java.nio.ByteBuffer dictionary)intavailable()voidclose()voidenableEagerOutput()intread()intread(byte[] b)intread(byte[] b, int off, int len)longskip(long n)
-
-
-
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
-
decoder
private final Decoder decoder
-
-
Constructor Detail
-
BrotliInputStream
public BrotliInputStream(java.io.InputStream source, int bufferSize) throws java.io.IOExceptionCreates a BrotliInputStream.- Parameters:
source- underlying sourcebufferSize- intermediate buffer size- Throws:
java.io.IOException
-
BrotliInputStream
public BrotliInputStream(java.io.InputStream source) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
attachDictionary
public void attachDictionary(java.nio.ByteBuffer dictionary) throws java.io.IOException- Throws:
java.io.IOException
-
enableEagerOutput
public void enableEagerOutput()
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
available
public int available()
- Overrides:
availablein classjava.io.InputStream
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
-