Class ChecksumIndexInput

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Cloneable
    Direct Known Subclasses:
    BufferedChecksumIndexInput

    public abstract class ChecksumIndexInput
    extends IndexInput
    Extension of IndexInput, computing checksum as it goes. Callers can retrieve the checksum via getChecksum().
    • Constructor Detail

      • ChecksumIndexInput

        protected ChecksumIndexInput​(java.lang.String resourceDescription)
        resourceDescription should be a non-null, opaque string describing this resource; it's returned from IndexInput.toString().
    • Method Detail

      • getChecksum

        public abstract long getChecksum()
                                  throws java.io.IOException
        Returns the current checksum value
        Throws:
        java.io.IOException
      • seek

        public void seek​(long pos)
                  throws java.io.IOException
        Sets current position in this file, where the next read will occur. If this is beyond the end of the file then this will throw EOFException and then the stream is in an undetermined state. ChecksumIndexInput can only seek forward and seeks are expensive since they imply to read bytes in-between the current position and the target position in order to update the checksum.
        Specified by:
        seek in class IndexInput
        Throws:
        java.io.IOException
        See Also:
        IndexInput.getFilePointer()