public class SnappyCompressorInputStream extends AbstractLZ77CompressorInputStream
This implementation uses an internal buffer in order to handle the back-references that are at the heart of the LZ77 algorithm. The size of the buffer must be at least as big as the biggest offset used in the compressed stream. The current version of the Snappy algorithm as defined by Google works on 32k blocks and doesn't contain offsets bigger than 32k which is the default block size used by this class.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BLOCK_SIZE
Default block size
|
Constructor and Description |
---|
SnappyCompressorInputStream(java.io.InputStream is)
Constructor using the default buffer size of 32k.
|
SnappyCompressorInputStream(java.io.InputStream is,
int blockSize)
Constructor using a configurable buffer size.
|
Modifier and Type | Method and Description |
---|---|
int |
getSize()
Get the uncompressed size of the stream
|
int |
read(byte[] b,
int off,
int len) |
available, close, getCompressedCount, prefill, read
getBytesRead, getCount, getUncompressedCount
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUncompressedCount
public static final int DEFAULT_BLOCK_SIZE
public SnappyCompressorInputStream(java.io.InputStream is) throws java.io.IOException
is
- An InputStream to read compressed data fromjava.io.IOException
- if reading failspublic SnappyCompressorInputStream(java.io.InputStream is, int blockSize) throws java.io.IOException
is
- An InputStream to read compressed data fromblockSize
- The block size used in compressionjava.io.IOException
- if reading failspublic int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int getSize()
getSize
in class AbstractLZ77CompressorInputStream
Copyright © 2010 - 2020 Adobe. All Rights Reserved