Package org.apache.lucene.store
Class ChecksumIndexInput
java.lang.Object
org.apache.lucene.store.DataInput
org.apache.lucene.store.IndexInput
org.apache.lucene.store.ChecksumIndexInput
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Cloneable
- Direct Known Subclasses:
BufferedChecksumIndexInput
Extension of IndexInput, computing checksum as it goes. Callers can retrieve the checksum via
getChecksum()
.-
Constructor Summary
ModifierConstructorDescriptionprotected
ChecksumIndexInput
(String resourceDescription) resourceDescription should be a non-null, opaque string describing this resource; it's returned fromIndexInput.toString()
. -
Method Summary
Modifier and TypeMethodDescriptionabstract long
Returns the current checksum valuevoid
seek
(long pos) Sets current position in this file, where the next read will occur.Methods inherited from class org.apache.lucene.store.IndexInput
clone, close, getFilePointer, getFullSliceDescription, length, randomAccessSlice, skipBytes, slice, toString
Methods inherited from class org.apache.lucene.store.DataInput
readByte, readBytes, readBytes, readFloats, readInt, readLong, readLongs, readMapOfStrings, readSetOfStrings, readShort, readString, readVInt, readVLong, readZInt, readZLong
-
Constructor Details
-
ChecksumIndexInput
resourceDescription should be a non-null, opaque string describing this resource; it's returned fromIndexInput.toString()
.
-
-
Method Details
-
getChecksum
Returns the current checksum value- Throws:
IOException
-
seek
Sets current position in this file, where the next read will occur. If this is beyond the end of the file then this will throwEOFException
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 classIndexInput
- Throws:
IOException
- See Also:
-