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
Inheritance
Implements
Inherited Members
Namespace: Lucene.Net.Store
Assembly: Lucene.Net.dll
Syntax
public abstract class IndexInput : DataInput, IDisposable
Constructors
| Improve this Doc View SourceIndexInput(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 |
---|---|---|
System.String | resourceDescription |
Properties
| Improve this Doc View SourceLength
The number of bytes in the file.
Declaration
public abstract long Length { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
| Improve this Doc View SourceClone()
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
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object |
Overrides
| Improve this Doc View SourceDispose()
Closes the stream to further operations.
Declaration
public void Dispose()
Dispose(Boolean)
Closes the stream to further operations.
Declaration
protected abstract void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
GetFilePointer()
Returns the current position in this file, where the next read will occur.
Declaration
public abstract long GetFilePointer()
Returns
Type | Description |
---|---|
System.Int64 |
See Also
| Improve this Doc View SourceSeek(Int64)
Sets current position in this file, where the next read will occur.
Declaration
public abstract void Seek(long pos)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | pos |
See Also
| Improve this Doc View SourceToString()
Returns the resourceDescription that was passed into the constructor.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |