Package com.palantir.common.compression
Class LZ4CompressingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.palantir.common.compression.BufferedDelegateInputStream
-
- com.palantir.common.compression.LZ4CompressingInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public final class LZ4CompressingInputStream extends BufferedDelegateInputStream
InputStream
that wraps a delegate InputStream, compressing its contents as they are read. Compression is managed via a compressingOutputStream
. Reads pull data as necessary from the delegate InputStream, write the uncompressed data through the OutputStream, then serve the read from the resulting compressed buffer.
-
-
Field Summary
-
Fields inherited from class com.palantir.common.compression.BufferedDelegateInputStream
buffer, BUFFER_START, delegate, READ_FAILED
-
-
Constructor Summary
Constructors Constructor Description LZ4CompressingInputStream(InputStream delegate)
LZ4CompressingInputStream(InputStream delegate, int blockSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected int
refill()
Refills the internal buffer from the delegateInputStream
.-
Methods inherited from class com.palantir.common.compression.BufferedDelegateInputStream
available, read, read
-
Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
LZ4CompressingInputStream
public LZ4CompressingInputStream(InputStream delegate)
-
LZ4CompressingInputStream
public LZ4CompressingInputStream(InputStream delegate, int blockSize)
-
-
Method Detail
-
refill
protected int refill() throws IOException
Description copied from class:BufferedDelegateInputStream
Refills the internal buffer from the delegateInputStream
.- Specified by:
refill
in classBufferedDelegateInputStream
- Returns:
- The number of bytes written to the buffer while refilling it.
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classBufferedDelegateInputStream
- Throws:
IOException
-
-