Package 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.FilterInputStreamInputStreamimplementation to decode data written withLZ4BlockOutputStream. This class is not thread-safe and does not supportmark(int)/reset().- See Also:
LZ4BlockOutputStream
-
-
Constructor Summary
Constructors Constructor Description LZ4BlockInputStream(java.io.InputStream in)Creates a new LZ4 input stream to read from the specified underlying InputStream, usingXXHash32for checksuming.LZ4BlockInputStream(java.io.InputStream in, boolean stopOnEmptyBlock)Creates a new LZ4 input stream to read from the specified underlying InputStream, usingXXHash32for checksuming.LZ4BlockInputStream(java.io.InputStream in, LZ4FastDecompressor decompressor)Creates a new LZ4 input stream to read from the specified underlying InputStream, usingXXHash32for 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidmark(int readlimit)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] b, int off, int len)voidreset()longskip(long n)java.lang.StringtoString()
-
-
-
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- theInputStreamto polldecompressor- thedecompressorinstance to usechecksum- theChecksuminstance to use, must be equivalent to the instance which has been used to write the streamstopOnEmptyBlock- 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- theInputStreamto polldecompressor- thedecompressorinstance to usechecksum- theChecksuminstance 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, usingXXHash32for checksuming.- Parameters:
in- theInputStreamto polldecompressor- thedecompressorinstance 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, usingXXHash32for checksuming.- Parameters:
in- theInputStreamto pollstopOnEmptyBlock- 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, usingXXHash32for checksuming.- Parameters:
in- theInputStreamto poll- See Also:
LZ4BlockInputStream(InputStream, LZ4FastDecompressor),LZ4Factory.fastestInstance()
-
-
Method Detail
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException- Overrides:
readin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.FilterInputStream
-
mark
public void mark(int readlimit)
- Overrides:
markin classjava.io.FilterInputStream
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.FilterInputStream- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-