Class 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 used in another thread. Subclasses must therefore implement Clone(), returning a new IndexInput which operates on the same underlying resource, but positioned independently. Lucene never closes cloned IndexInputs, it will only do this on the original one. The original instance must take care that cloned instances throw ObjectDisposedException when the original one is closed.Inheritance
IndexInput
Implements
Inherited Members
Namespace: Lucene.Net.Store
Assembly: Lucene.Net.dll
Syntax
public abstract class IndexInput : DataInput, IDisposable
Constructors
IndexInput(string)
resourceDescription
should be a non-null, opaque string
describing this resource; it's returned from
ToString().
Declaration
protected IndexInput(string resourceDescription)
Parameters
Type | Name | Description |
---|---|---|
string | resourceDescription |
See Also
Properties
Length
The number of bytes in the file.
Declaration
public abstract long Length { get; }
Property Value
Type | Description |
---|---|
long |
See Also
Position
Returns the current position in this file, where the next read will occur.
This was getFilePointer() in Lucene.Declaration
public abstract long Position { get; }
Property Value
Type | Description |
---|---|
long |
See Also
Methods
Clone()
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 IndexInputs, it will only do this on the original one. The original instance must take care that cloned instances throw ObjectDisposedException when the original one is closed.Declaration
public override object Clone()
Returns
Type | Description |
---|---|
object |
Overrides
See Also
Dispose()
Closes the stream to further operations.
Declaration
public void Dispose()
See Also
Dispose(bool)
Closes the stream to further operations.
Declaration
protected abstract void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
See Also
Seek(long)
Sets current position in this file, where the next read will occur.
Declaration
public abstract void Seek(long pos)
Parameters
Type | Name | Description |
---|---|---|
long | pos |
See Also
ToString()
Returns the resourceDescription that was passed into the constructor.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |