Module org.apache.lucene.core
Package org.apache.lucene.store
Class BufferedIndexInput.SlicedIndexInput
java.lang.Object
org.apache.lucene.store.DataInput
org.apache.lucene.store.IndexInput
org.apache.lucene.store.BufferedIndexInput
org.apache.lucene.store.BufferedIndexInput.SlicedIndexInput
- All Implemented Interfaces:
Closeable,AutoCloseable,Cloneable,RandomAccessInput
- Enclosing class:
BufferedIndexInput
Implementation of an IndexInput that reads from a portion of a file.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) IndexInput(package private) long(package private) longFields inherited from class org.apache.lucene.store.BufferedIndexInput
BUFFER_SIZE, MERGE_BUFFER_SIZE, MIN_BUFFER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionSlicedIndexInput(String sliceDescription, IndexInput base, long offset, long length) -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a clone of this stream.voidclose()Closes the stream to further operations.longlength()The number of bytes in the file.protected voidExpert: implements buffer refill.protected voidseekInternal(long pos) Expert: implements seek.Methods inherited from class org.apache.lucene.store.BufferedIndexInput
bufferSize, getBufferSize, getFilePointer, readByte, readByte, readBytes, readBytes, readFloats, readGroupVInt, readInt, readInt, readInts, readLong, readLong, readLongs, readShort, readShort, readVInt, readVLong, seek, slice, wrapMethods inherited from class org.apache.lucene.store.IndexInput
getFullSliceDescription, randomAccessSlice, skipBytes, toStringMethods inherited from class org.apache.lucene.store.DataInput
readGroupVInts, readMapOfStrings, readSetOfStrings, readString, readZInt, readZLong
-
Field Details
-
base
IndexInput base -
fileOffset
long fileOffset -
length
long length
-
-
Constructor Details
-
SlicedIndexInput
SlicedIndexInput(String sliceDescription, IndexInput base, long offset, long length)
-
-
Method Details
-
clone
Description copied from class:IndexInputReturns a clone of this stream.Clones of a stream access the same data, and are positioned at the same point as the stream they were cloned from.
Expert: Subclasses must ensure that clones may be positioned at different points in the input from each other and from the stream they were cloned from.
Warning: Lucene never closes cloned
IndexInputs, it will only callIndexInput.close()on the original object.If you access the cloned IndexInput after closing the original object, any
readXXXmethods will throwAlreadyClosedException.This method is NOT thread safe, so if the current
IndexInputis being used by one thread whilecloneis called by another, disaster could strike.- Overrides:
clonein classBufferedIndexInput
-
readInternal
Description copied from class:BufferedIndexInputExpert: implements buffer refill. Reads bytes from the current position in the input.- Specified by:
readInternalin classBufferedIndexInput- Parameters:
b- the buffer to read bytes into- Throws:
IOException
-
seekInternal
protected void seekInternal(long pos) Description copied from class:BufferedIndexInputExpert: implements seek. Sets current position in this file, where the nextBufferedIndexInput.readInternal(ByteBuffer)will occur.- Specified by:
seekInternalin classBufferedIndexInput- See Also:
-
close
Description copied from class:IndexInputCloses the stream to further operations.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classIndexInput- Throws:
IOException
-
length
public long length()Description copied from class:IndexInputThe number of bytes in the file.- Specified by:
lengthin interfaceRandomAccessInput- Specified by:
lengthin classIndexInput
-