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.InputStreamInputStream 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 voidattachDictionary(java.nio.ByteBuffer dictionary)Creates a BrotliInputStreamintavailable()voidclose()voidenableEagerOutput()intread()intread(byte[] b)intread(byte[] b, int off, int len)longskip(long n)
-
-
-
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- If any failure during initialization
-
BrotliInputStream
public BrotliInputStream(java.io.InputStream source) throws java.io.IOExceptionCreates 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.IOExceptionCreates a BrotliInputStream- Parameters:
dictionary-ByteBuffercontaining dictionary- Throws:
java.io.IOException- If any failure during initialization
-
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
-
-