IndexInput
Abstract base class for input from a file in a Directory. A random-access input stream. Used for all Lucene index input operations.
IndexInput may only be used from one thread, because it is not thread safe (it keeps internal state like file position). To allow multithreaded use, every IndexInput instance must be cloned before it is used in another thread. Subclasses must therefore implement .clone, returning a new IndexInput which operates on the same underlying resource, but positioned independently.
Warning: Lucene never closes cloned IndexInputs, it will only call .close on the original object.
If you access the cloned IndexInput after closing the original object, any readXXX * methods will throw AlreadyClosedException.
See also
Inheritors
Properties
Functions
{@inheritDoc}
Creates a random-access slice of this index input, with the given offset and length.
Reads a specified number of bytes into an array at the specified offset.
Reads a specified number of bytes into an array at the specified offset with control over whether the read should be buffered (callers who have their own buffer should pass in "false" for useBuffer). Currently only BufferedIndexInput respects this parameter.
Reads a specified number of floats into an array at the specified offset.
Override if you have an efficient implementation. In general this is when the input supports random access.
Reads a Set
Reads a string.
Creates a slice of this index input, with the given description, offset, and length. The slice is sought to the beginning.
Create a slice with a specific ReadAdvice. This is typically used by [ ] implementations to honor the ReadAdvice of each file within the compound file.
Optional method: Give a hint to this input about the change in read access pattern. IndexInput implementations may take advantage of this hint to optimize reads from storage.