net.jpountz.lz4
Class LZ4BlockInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- net.jpountz.lz4.LZ4BlockInputStream
-
- All Implemented Interfaces:
- java.io.Closeable, java.lang.AutoCloseable
public class LZ4BlockInputStream extends java.io.FilterInputStream
InputStream
implementation to decode data written withLZ4BlockOutputStream
. This class is not thread-safe and does not supportmark(int)
/reset()
.- See Also:
-
LZ4BlockOutputStream
-
Constructor Summary
Constructors Constructor and Description LZ4BlockInputStream(java.io.InputStream in)
Creates a new LZ4 input stream to read from the specified underlying InputStream, usingXXHash32
for checksuming.LZ4BlockInputStream(java.io.InputStream in, boolean stopOnEmptyBlock)
Creates a new LZ4 input stream to read from the specified underlying InputStream, usingXXHash32
for checksuming.LZ4BlockInputStream(java.io.InputStream in, LZ4FastDecompressor decompressor)
Creates a new LZ4 input stream to read from the specified underlying InputStream, usingXXHash32
for checksuming.LZ4BlockInputStream(java.io.InputStream in, LZ4FastDecompressor decompressor, java.util.zip.Checksum checksum)
Creates a new LZ4 input stream to read from the specified underlying InputStream.LZ4BlockInputStream(java.io.InputStream in, LZ4FastDecompressor decompressor, java.util.zip.Checksum checksum, boolean stopOnEmptyBlock)
Creates a new LZ4 input stream to read from the specified underlying InputStream.
-
Constructor Detail
LZ4BlockInputStream
public LZ4BlockInputStream(java.io.InputStream in, LZ4FastDecompressor decompressor, java.util.zip.Checksum checksum, boolean stopOnEmptyBlock)
Creates a new LZ4 input stream to read from the specified underlying InputStream.- Parameters:
-
in
- theInputStream
to poll -
decompressor
- thedecompressor
instance to use -
checksum
- theChecksum
instance to use, must be equivalent to the instance which has been used to write the stream -
stopOnEmptyBlock
- whether read is stopped on an empty block
LZ4BlockInputStream
public LZ4BlockInputStream(java.io.InputStream in, LZ4FastDecompressor decompressor, java.util.zip.Checksum checksum)
Creates a new LZ4 input stream to read from the specified underlying InputStream.- Parameters:
-
in
- theInputStream
to poll -
decompressor
- thedecompressor
instance to use -
checksum
- theChecksum
instance to use, must be equivalent to the instance which has been used to write the stream - See Also:
-
LZ4BlockInputStream(InputStream, LZ4FastDecompressor, Checksum, boolean)
LZ4BlockInputStream
public LZ4BlockInputStream(java.io.InputStream in, LZ4FastDecompressor decompressor)
Creates a new LZ4 input stream to read from the specified underlying InputStream, usingXXHash32
for checksuming.- Parameters:
-
in
- theInputStream
to poll -
decompressor
- thedecompressor
instance to use - See Also:
-
LZ4BlockInputStream(InputStream, LZ4FastDecompressor, Checksum, boolean)
,StreamingXXHash32.asChecksum()
LZ4BlockInputStream
public LZ4BlockInputStream(java.io.InputStream in, boolean stopOnEmptyBlock)
Creates a new LZ4 input stream to read from the specified underlying InputStream, usingXXHash32
for checksuming.- Parameters:
-
in
- theInputStream
to poll -
stopOnEmptyBlock
- whether read is stopped on an empty block - See Also:
-
LZ4BlockInputStream(InputStream, LZ4FastDecompressor, Checksum, boolean)
,LZ4Factory.fastestInstance()
,StreamingXXHash32.asChecksum()
LZ4BlockInputStream
public LZ4BlockInputStream(java.io.InputStream in)
Creates a new LZ4 input stream to read from the specified underlying InputStream, usingXXHash32
for checksuming.- Parameters:
-
in
- theInputStream
to poll - See Also:
-
LZ4BlockInputStream(InputStream, LZ4FastDecompressor)
,LZ4Factory.fastestInstance()
Method Detail
available
public int available() throws java.io.IOException
- Overrides:
-
available
in classjava.io.FilterInputStream
- Throws:
-
java.io.IOException
read
public int read() throws java.io.IOException
- Overrides:
-
read
in classjava.io.FilterInputStream
- Throws:
-
java.io.IOException
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
-
read
in classjava.io.FilterInputStream
- Throws:
-
java.io.IOException
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
-
read
in classjava.io.FilterInputStream
- Throws:
-
java.io.IOException
skip
public long skip(long n) throws java.io.IOException
- Overrides:
-
skip
in classjava.io.FilterInputStream
- Throws:
-
java.io.IOException
markSupported
public boolean markSupported()
- Overrides:
-
markSupported
in classjava.io.FilterInputStream
mark
public void mark(int readlimit)
- Overrides:
-
mark
in classjava.io.FilterInputStream
reset
public void reset() throws java.io.IOException
- Overrides:
-
reset
in classjava.io.FilterInputStream
- Throws:
-
java.io.IOException
toString
public java.lang.String toString()
- Overrides:
-
toString
in classjava.lang.Object