Based on the "spec" in the version "Last revised: 2013-10-25"
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final PureJavaCrc32C | |
| pack-priv static final int | |
| private final CountingInputStream | |
| private SnappyCompressorInputStream | |
| private final FramedSnappyDialect | dialect
The dialect to expect |
| private boolean | |
| private long | |
| private final PushbackInputStream | inputStream
The underlying stream to read compressed data from |
| private boolean | |
| pack-priv static final long | MASK_OFFSET
package private for tests only. |
| private static final int | |
| private static final int | |
| private static final int | |
| private final byte[] | |
| private static final int | |
| private static final int | |
| private final ByteUtils. | |
| pack-priv static final byte[] | |
| private static final int | |
| private int | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | FramedSnappyCompressorInputStream(final InputStream
the InputStream from which to read the compressed data in)Constructs a new input stream that decompresses snappy-framed-compressed data from the specified input stream using the
|
| public | FramedSnappyCompressorInputStream(final InputStream
the InputStream from which to read the compressed data in, final FramedSnappyDialect the dialect used by the compressed stream dialect)Constructs a new input stream that decompresses snappy-framed-compressed data from the specified input stream. |
| public | FramedSnappyCompressorInputStream(final InputStream
the InputStream from which to read the compressed data in, final int the block size to use for the compressed stream blockSize, final FramedSnappyDialect the dialect used by the compressed stream dialect)Constructs a new input stream that decompresses snappy-framed-compressed data from the specified input stream. |
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Overrides java. |
| public void | close()
Overrides java. Implements java. |
| public long | getCompressedCount()
Implements org. |
| public static boolean | Returns: true if this is a .sz stream, false otherwisethe bytes to check signature, final int the number of bytes to check length)Checks if the signature matches what is expected for a .sz file. |
| public int | read()
Implements abstract java. |
| public int | read(final byte[]
the buffer into which the data is read. b, final int the start offset in array off, final int b
at which the data is written.the maximum number of bytes to read. len)Overrides java. len bytes of data from the input stream into
an array of bytes.
|
| private long | |
| private void | |
| private int | Returns: -1 if there is no current chunk or the number of bytes read from the current chunk (which may be -1 if the end of the chunk is reached).Read from the current chunk into the given array. |
| private int | |
| private int | |
| private void | |
| private void | |
| pack-priv static long | |
| private void |
| blockSize | back to summary |
|---|---|
| private final int blockSize | |
| checksum | back to summary |
|---|---|
| private final PureJavaCrc32C checksum | |
| COMPRESSED_CHUNK_TYPE | back to summary |
|---|---|
| pack-priv static final int COMPRESSED_CHUNK_TYPE | |
| countingStream | back to summary |
|---|---|
| private final CountingInputStream countingStream | |
| currentCompressedChunk | back to summary |
|---|---|
| private SnappyCompressorInputStream currentCompressedChunk | |
| dialect | back to summary |
|---|---|
| private final FramedSnappyDialect dialect The dialect to expect | |
| endReached | back to summary |
|---|---|
| private boolean endReached | |
| expectedChecksum | back to summary |
|---|---|
| private long expectedChecksum | |
| inputStream | back to summary |
|---|---|
| private final PushbackInputStream inputStream The underlying stream to read compressed data from | |
| inUncompressedChunk | back to summary |
|---|---|
| private boolean inUncompressedChunk | |
| MASK_OFFSET | back to summary |
|---|---|
| pack-priv static final long MASK_OFFSET package private for tests only. | |
| MAX_SKIPPABLE_TYPE | back to summary |
|---|---|
| private static final int MAX_SKIPPABLE_TYPE | |
| MAX_UNSKIPPABLE_TYPE | back to summary |
|---|---|
| private static final int MAX_UNSKIPPABLE_TYPE | |
| MIN_UNSKIPPABLE_TYPE | back to summary |
|---|---|
| private static final int MIN_UNSKIPPABLE_TYPE | |
| oneByte | back to summary |
|---|---|
| private final byte[] oneByte | |
| PADDING_CHUNK_TYPE | back to summary |
|---|---|
| private static final int PADDING_CHUNK_TYPE | |
| STREAM_IDENTIFIER_TYPE | back to summary |
|---|---|
| private static final int STREAM_IDENTIFIER_TYPE | |
| supplier | back to summary |
|---|---|
| private final ByteUtils. | |
| SZ_SIGNATURE | back to summary |
|---|---|
| pack-priv static final byte[] SZ_SIGNATURE | |
| UNCOMPRESSED_CHUNK_TYPE | back to summary |
|---|---|
| private static final int UNCOMPRESSED_CHUNK_TYPE | |
| uncompressedBytesRemaining | back to summary |
|---|---|
| private int uncompressedBytesRemaining | |
| unreadBytes | back to summary |
|---|---|
| private long unreadBytes | |
| FramedSnappyCompressorInputStream | back to summary |
|---|---|
| public FramedSnappyCompressorInputStream(final InputStream in) throws IOException Constructs a new input stream that decompresses snappy-framed-compressed data from the specified input stream using the
| |
| FramedSnappyCompressorInputStream | back to summary |
|---|---|
| public FramedSnappyCompressorInputStream(final InputStream in, final FramedSnappyDialect dialect) throws IOException Constructs a new input stream that decompresses snappy-framed-compressed data from the specified input stream.
| |
| FramedSnappyCompressorInputStream | back to summary |
|---|---|
| public FramedSnappyCompressorInputStream(final InputStream in, final int blockSize, final FramedSnappyDialect dialect) throws IOException Constructs a new input stream that decompresses snappy-framed-compressed data from the specified input stream.
| |
| available | back to summary |
|---|---|
| public int available() throws IOException Overrides java. Doc from java. Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking, which may be 0, or 0 when end of stream is detected. The read might be on the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes. Note that while some implementations of A subclass's implementation of this method may choose to throw an
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream.
| |
| getCompressedCount | back to summary |
|---|---|
| public long getCompressedCount() Implements org. Doc from org. Gets the amount of raw or compressed bytes read by the stream.
| |
| matches | back to summary |
|---|---|
| public static boolean matches(final byte[] signature, final int length) Checks if the signature matches what is expected for a .sz file. .sz files start with a chunk with tag 0xff and content sNaPpY.
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| read | back to summary |
|---|---|
| public int read(final byte[] b, final int off, final int len) throws IOException Overrides java. Doc from java. Reads up to This method blocks until input data is available, end of file is detected, or an exception is thrown. If The first byte read is stored into element In every case, elements
| |
| readCrc | back to summary |
|---|---|
| private long readCrc() throws IOException | |
| readNextBlock | back to summary |
|---|---|
| private void readNextBlock() throws IOException | |
| readOnce | back to summary |
|---|---|
| private int readOnce(final byte[] b, final int off, final int len) throws IOException Read from the current chunk into the given array.
| |
| readOneByte | back to summary |
|---|---|
| private int readOneByte() throws IOException | |
| readSize | back to summary |
|---|---|
| private int readSize() throws IOException | |
| readStreamIdentifier | back to summary |
|---|---|
| private void readStreamIdentifier() throws IOException | |
| skipBlock | back to summary |
|---|---|
| private void skipBlock() throws IOException | |
| unmask | back to summary |
|---|---|
| pack-priv static long unmask(long x) | |
| verifyLastChecksumAndReset | back to summary |
|---|---|
| private void verifyLastChecksumAndReset() throws IOException | |