public class CompressionInputStream extends InputStream
Modifier and Type | Field and Description |
---|---|
private boolean |
allDataRead |
private byte[] |
buffer |
private int |
bufferIndex |
private byte[] |
compressedBuffer |
private boolean |
eos |
private byte[] |
fourByteBuffer |
private InputStream |
in |
private Inflater |
inflater |
Constructor and Description |
---|
CompressionInputStream(InputStream in) |
Modifier and Type | Method and Description |
---|---|
protected void |
bufferAndDecompress() |
void |
close()
Calls
Inflater.end() to free acquired memory to prevent OutOfMemory error. |
private void |
fillBuffer(byte[] buffer) |
private boolean |
isBufferEmpty() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
protected void |
readChunkHeader() |
private String |
toHex(byte[] array) |
private int |
toInt(byte[] data) |
available, mark, markSupported, reset, skip
private final InputStream in
private final Inflater inflater
private byte[] compressedBuffer
private byte[] buffer
private int bufferIndex
private boolean eos
private boolean allDataRead
private final byte[] fourByteBuffer
public CompressionInputStream(InputStream in)
private String toHex(byte[] array)
protected void readChunkHeader() throws IOException
IOException
private int toInt(byte[] data)
protected void bufferAndDecompress() throws IOException
IOException
private void fillBuffer(byte[] buffer) throws IOException
IOException
private boolean isBufferEmpty()
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public void close() throws IOException
Inflater.end()
to free acquired memory to prevent OutOfMemory error.
However, does NOT close underlying InputStream.close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
- for any issues closing underlying streamCopyright © 2022 Apache NiFi Project. All rights reserved.