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.InputStream
InputStream that wraps native brotli decoder.
-
-
Field Summary
Fields Modifier and Type Field Description private Decoder
decoder
private static int
DEFAULT_BUFFER_SIZE
The 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 void
attachDictionary(java.nio.ByteBuffer dictionary)
int
available()
void
close()
void
enableEagerOutput()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
long
skip(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.IOException
Creates 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
available
public int available()
- Overrides:
available
in classjava.io.InputStream
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-