Class AbstractSnappyInputStream

java.lang.Object
java.io.InputStream
org.iq80.snappy.AbstractSnappyInputStream
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
SnappyFramedInputStream, SnappyInputStream

abstract class AbstractSnappyInputStream extends InputStream
A common base class for frame based snappy input streams.
  • Field Details

    • in

      private final InputStream in
    • frameHeader

      private final byte[] frameHeader
    • verifyChecksums

      private final boolean verifyChecksums
    • recycler

      private final BufferRecycler recycler
    • input

      private byte[] input
      A single frame read from the underlying InputStream.
    • uncompressed

      private byte[] uncompressed
      The decompressed data from input.
    • closed

      private boolean closed
      Indicates if this instance has been closed.
    • eof

      private boolean eof
      Indicates if we have reached the EOF on in.
    • valid

      private int valid
      The position in input to read to.
    • position

      private int position
      The next position to read from buffer.
    • buffer

      private byte[] buffer
      Buffer is a reference to the real buffer of uncompressed data for the current block: uncompressed if the block is compressed, or input if it is not.
  • Constructor Details

    • AbstractSnappyInputStream

      public AbstractSnappyInputStream(InputStream in, int maxBlockSize, int frameHeaderSize, boolean verifyChecksums, byte[] expectedHeader) throws IOException
      Creates a Snappy input stream to read data from the specified underlying input stream.
      Parameters:
      in - the underlying input stream
      verifyChecksums - if true, checksums in input stream will be verified
      expectedHeader - the expected stream header
      Throws:
      IOException
  • Method Details