Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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
    object
    DataInput
    IndexInput
    BufferedIndexInput
    ByteBufferIndexInput
    ChecksumIndexInput
    RAMInputStream
    Implements
    IDisposable
    Inherited Members
    DataInput.ReadByte()
    DataInput.ReadBytes(byte[], int, int)
    DataInput.ReadBytes(byte[], int, int, bool)
    DataInput.ReadInt16()
    DataInput.ReadInt32()
    DataInput.ReadVInt32()
    DataInput.ReadInt64()
    DataInput.ReadVInt64()
    DataInput.ReadString()
    DataInput.ReadStringStringMap()
    DataInput.ReadStringSet()
    DataInput.SkipBytes(long)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    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
    Directory

    Properties

    Length

    The number of bytes in the file.

    Declaration
    public abstract long Length { get; }
    Property Value
    Type Description
    long
    See Also
    Directory

    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
    Seek(long)

    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
    DataInput.Clone()
    See Also
    Directory

    Dispose()

    Closes the stream to further operations.

    Declaration
    public void Dispose()
    See Also
    Directory

    Dispose(bool)

    Closes the stream to further operations.

    Declaration
    protected abstract void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    See Also
    Directory

    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
    Position

    ToString()

    Returns the resourceDescription that was passed into the constructor.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    See Also
    Directory

    Implements

    IDisposable

    See Also

    Directory
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.