Package org.apache.lucene.store
Class FSDirectory.FSIndexInput
java.lang.Object
org.apache.lucene.store.DataInput
org.apache.lucene.store.IndexInput
org.apache.lucene.store.BufferedIndexInput
org.apache.lucene.store.FSDirectory.FSIndexInput
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Cloneable
- Direct Known Subclasses:
NIOFSDirectory.NIOFSIndexInput
,SimpleFSDirectory.SimpleFSIndexInput
- Enclosing class:
- FSDirectory
Base class for reading input from a RandomAccessFile
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final long
end offset (start+length)protected final RandomAccessFile
the underlying RandomAccessFileprotected final long
start offset: non-zero in the slice caseFields inherited from class org.apache.lucene.store.BufferedIndexInput
buffer, BUFFER_SIZE, MERGE_BUFFER_SIZE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FSIndexInput
(String resourceDesc, File path, IOContext context) Create a new FSIndexInput, reading the entire file frompath
protected
FSIndexInput
(String resourceDesc, RandomAccessFile file, long off, long length, int bufferSize) Create a new FSIndexInput, representing a slice of an existing openfile
-
Method Summary
Methods inherited from class org.apache.lucene.store.BufferedIndexInput
bufferSize, flushBuffer, getBufferSize, getFilePointer, newBuffer, readByte, readBytes, readBytes, readInt, readInternal, readLong, readShort, readVInt, readVLong, seek, seekInternal, setBufferSize
Methods inherited from class org.apache.lucene.store.IndexInput
toString
Methods inherited from class org.apache.lucene.store.DataInput
readString, readStringSet, readStringStringMap
-
Field Details
-
file
the underlying RandomAccessFile -
off
protected final long offstart offset: non-zero in the slice case -
end
protected final long endend offset (start+length)
-
-
Constructor Details
-
FSIndexInput
Create a new FSIndexInput, reading the entire file frompath
- Throws:
IOException
-
FSIndexInput
protected FSIndexInput(String resourceDesc, RandomAccessFile file, long off, long length, int bufferSize) Create a new FSIndexInput, representing a slice of an existing openfile
-
-
Method Details
-
close
Description copied from class:IndexInput
Closes the stream to further operations.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classIndexInput
- Throws:
IOException
-
clone
Description copied from class:IndexInput
Returns 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
IndexInput
s, it will only do this on the original one. The original instance must take care that cloned instances throwAlreadyClosedException
when the original one is closed.- Overrides:
clone
in classBufferedIndexInput
-
length
public final long length()Description copied from class:IndexInput
The number of bytes in the file.- Specified by:
length
in classIndexInput
-