public class BrotliInputStream
extends java.io.InputStream
InputStream decorator that decompresses brotli data.
Not thread-safe.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_INTERNAL_BUFFER_SIZE |
| Constructor and Description |
|---|
BrotliInputStream(java.io.InputStream source)
Creates a
InputStream wrapper that decompresses brotli data. |
BrotliInputStream(java.io.InputStream source,
int byteReadBufferSize)
Creates a
InputStream wrapper that decompresses brotli data. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
read() |
int |
read(byte[] destBuffer,
int destOffset,
int destLen) |
public static final int DEFAULT_INTERNAL_BUFFER_SIZE
public BrotliInputStream(java.io.InputStream source)
throws java.io.IOException
InputStream wrapper that decompresses brotli data.
For byte-by-byte reading (read()) internal buffer with
DEFAULT_INTERNAL_BUFFER_SIZE size is allocated and used.
Will block the thread until first kilobyte of data of source is available.
source - underlying data sourcejava.io.IOException - in case of corrupted data or source stream problemspublic BrotliInputStream(java.io.InputStream source,
int byteReadBufferSize)
throws java.io.IOException
InputStream wrapper that decompresses brotli data.
For byte-by-byte reading (read()) internal buffer of specified size
is allocated and used.
Will block the thread until first kilobyte of data of source is available.
source - compressed data sourcebyteReadBufferSize - size of internal buffer used in case of
byte-by-byte readingjava.io.IOException - in case of corrupted data or source stream problemspublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] destBuffer,
int destOffset,
int destLen)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException