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,EndiannessReverserChecksumIndexInput
Extension of IndexInput, computing checksum as it goes. Callers can retrieve the checksum via
getChecksum().-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate byte[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedChecksumIndexInput(String resourceDescription) resourceDescription should be a non-null, opaque string describing this resource; it's returned fromIndexInput.toString(). -
Method Summary
Modifier and TypeMethodDescriptionabstract longReturns the current checksum valuevoidseek(long pos) Sets current position in this file, where the next read will occur.private voidskipByReading(long numBytes) Skip overnumBytesbytes.Methods inherited from class org.apache.lucene.store.IndexInput
clone, close, getFilePointer, getFullSliceDescription, length, randomAccessSlice, skipBytes, slice, toStringMethods inherited from class org.apache.lucene.store.DataInput
readByte, readBytes, readBytes, readFloats, readGroupVInt, readGroupVInts, readInt, readInts, readLong, readLongs, readMapOfStrings, readSetOfStrings, readShort, readString, readVInt, readVLong, readZInt, readZLong
-
Field Details
-
SKIP_BUFFER_SIZE
private static final int SKIP_BUFFER_SIZE- See Also:
-
skipBuffer
private byte[] skipBuffer
-
-
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 throwEOFExceptionand then the stream is in an undetermined state.ChecksumIndexInputcan 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:
seekin classIndexInput- Throws:
IOException- See Also:
-
skipByReading
Skip overnumBytesbytes. The contract on this method is that it should have the same behavior as reading the same number of bytes into a buffer and discarding its content. Negative values ofnumBytesare not supported.- Throws:
IOException
-