Class BrotliInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.aayushatharva.brotli4j.decoder.BrotliInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class BrotliInputStream extends java.io.InputStream
InputStream that wraps native brotli decoder.
-
-
Constructor Summary
Constructors Constructor Description BrotliInputStream(java.io.InputStream source)
Creates a BrotliInputStreamBrotliInputStream(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)
Creates a BrotliInputStreamint
available()
void
close()
void
enableEagerOutput()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
long
skip(long n)
-
-
-
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
- If any failure during initialization
-
BrotliInputStream
public BrotliInputStream(java.io.InputStream source) throws java.io.IOException
Creates a BrotliInputStream- Parameters:
source
- underlying source- Throws:
java.io.IOException
- If any failure during initialization
-
-
Method Detail
-
attachDictionary
public void attachDictionary(java.nio.ByteBuffer dictionary) throws java.io.IOException
Creates a BrotliInputStream- Parameters:
dictionary
-ByteBuffer
containing dictionary- Throws:
java.io.IOException
- If any failure during initialization
-
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
-
-