Package org.apache.nifi.remote.io
Class CompressionInputStream
java.lang.Object
java.io.InputStream
org.apache.nifi.remote.io.CompressionInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate byte[]private intprivate byte[]private booleanprivate final byte[]private final InputStreamprivate final Inflater -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidclose()CallsInflater.end()to free acquired memory to prevent OutOfMemory error.private voidfillBuffer(byte[] buffer) private booleanintread()intread(byte[] b) intread(byte[] b, int off, int len) protected voidprivate StringtoHex(byte[] array) private inttoInt(byte[] data) Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
in
-
inflater
-
compressedBuffer
private byte[] compressedBuffer -
buffer
private byte[] buffer -
bufferIndex
private int bufferIndex -
eos
private boolean eos -
allDataRead
private boolean allDataRead -
fourByteBuffer
private final byte[] fourByteBuffer
-
-
Constructor Details
-
CompressionInputStream
-
-
Method Details
-
toHex
-
readChunkHeader
- Throws:
IOException
-
toInt
private int toInt(byte[] data) -
bufferAndDecompress
- Throws:
IOException
-
fillBuffer
- Throws:
IOException
-
isBufferEmpty
private boolean isBufferEmpty() -
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
close
CallsInflater.end()to free acquired memory to prevent OutOfMemory error. However, does NOT close underlying InputStream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- for any issues closing underlying stream
-