public class FramedSnappyCompressorInputStream extends CompressorInputStream implements InputStreamStatistics
Based on the "spec" in the version "Last revised: 2013-10-25"
Constructor and Description |
---|
FramedSnappyCompressorInputStream(InputStream in)
Constructs a new input stream that decompresses
snappy-framed-compressed data from the specified input stream
using the
FramedSnappyDialect.STANDARD dialect. |
FramedSnappyCompressorInputStream(InputStream in,
FramedSnappyDialect dialect)
Constructs a new input stream that decompresses snappy-framed-compressed data
from the specified input stream.
|
FramedSnappyCompressorInputStream(InputStream in,
int blockSize,
FramedSnappyDialect dialect)
Constructs a new input stream that decompresses snappy-framed-compressed data
from the specified input stream.
|
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
long |
getCompressedCount() |
static boolean |
matches(byte[] signature,
int length)
Checks if the signature matches what is expected for a .sz file.
|
int |
read() |
int |
read(byte[] b,
int off,
int len) |
count, count, getBytesRead, getCount, getUncompressedCount, pushedBackBytes
mark, markSupported, read, reset, skip
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUncompressedCount
public FramedSnappyCompressorInputStream(InputStream in) throws IOException
FramedSnappyDialect.STANDARD
dialect.in
- the InputStream from which to read the compressed dataIOException
- if reading failspublic FramedSnappyCompressorInputStream(InputStream in, FramedSnappyDialect dialect) throws IOException
in
- the InputStream from which to read the compressed datadialect
- the dialect used by the compressed streamIOException
- if reading failspublic FramedSnappyCompressorInputStream(InputStream in, int blockSize, FramedSnappyDialect dialect) throws IOException
in
- the InputStream from which to read the compressed datablockSize
- the block size to use for the compressed streamdialect
- the dialect used by the compressed streamIOException
- if reading failsIllegalArgumentException
- if blockSize is not bigger than 0public int read() throws IOException
read
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
public long getCompressedCount()
getCompressedCount
in interface InputStreamStatistics
public static boolean matches(byte[] signature, int length)
.sz files start with a chunk with tag 0xff and content sNaPpY.
signature
- the bytes to checklength
- the number of bytes to checkCopyright © 2020 The Apache Software Foundation. All rights reserved.