Class BufferedChecksumStreamInput

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public final class BufferedChecksumStreamInput
    extends FilterStreamInput
    Similar to Lucene's BufferedChecksumIndexInput, however this wraps a StreamInput so anything read will update the checksum
    • Constructor Detail

      • BufferedChecksumStreamInput

        public BufferedChecksumStreamInput​(StreamInput in,
                                           java.lang.String source)
    • Method Detail

      • getChecksum

        public long getChecksum()
      • readByte

        public byte readByte()
                      throws java.io.IOException
        Description copied from class: StreamInput
        Reads and returns a single byte.
        Overrides:
        readByte in class FilterStreamInput
        Throws:
        java.io.IOException
      • readBytes

        public void readBytes​(byte[] b,
                              int offset,
                              int len)
                       throws java.io.IOException
        Description copied from class: StreamInput
        Reads a specified number of bytes into an array at the specified offset.
        Overrides:
        readBytes in class FilterStreamInput
        Parameters:
        b - the array to read bytes into
        offset - the offset in the array to start storing bytes
        len - the number of bytes to read
        Throws:
        java.io.IOException
      • reset

        public void reset()
                   throws java.io.IOException
        Overrides:
        reset in class FilterStreamInput
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class FilterStreamInput
        Throws:
        java.io.IOException
      • markSupported

        public boolean markSupported()
        Overrides:
        markSupported in class java.io.InputStream
      • skip

        public long skip​(long numBytes)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.InputStream
        Throws:
        java.io.IOException
      • mark

        public void mark​(int readlimit)
        Overrides:
        mark in class java.io.InputStream
      • resetDigest

        public void resetDigest()
      • getSource

        public java.lang.String getSource()