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 when the original one is closed.

    Inheritance
    System.Object
    DataInput
    IndexInput
    BufferedIndexInput
    ByteBufferIndexInput
    ChecksumIndexInput
    RAMInputStream
    Implements
    IDisposable
    Inherited Members
    DataInput.ReadByte()
    DataInput.ReadBytes(Byte[], Int32, Int32)
    DataInput.ReadBytes(Byte[], Int32, Int32, Boolean)
    DataInput.ReadInt16()
    DataInput.ReadInt32()
    DataInput.ReadVInt32()
    DataInput.ReadInt64()
    DataInput.ReadVInt64()
    DataInput.ReadString()
    DataInput.ReadStringStringMap()
    DataInput.ReadStringSet()
    DataInput.SkipBytes(Int64)
    Namespace: Lucene.Net.Store
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class IndexInput : DataInput, IDisposable

    Constructors

    | Improve this Doc View Source

    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
    System.String resourceDescription

    Properties

    | Improve this Doc View Source

    Length

    The number of bytes in the file.

    Declaration
    public abstract long Length { get; }
    Property Value
    Type Description
    System.Int64

    Methods

    | Improve this Doc View Source

    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 when the original one is closed.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object
    Overrides
    DataInput.Clone()
    | Improve this Doc View Source

    Dispose()

    Closes the stream to further operations.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Closes the stream to further operations.

    Declaration
    protected abstract void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    | Improve this Doc View Source

    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
    Seek(Int64)
    | Improve this Doc View Source

    Seek(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
    GetFilePointer()
    | Improve this Doc View Source

    ToString()

    Returns the resourceDescription that was passed into the constructor.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    Implements

    IDisposable

    See Also

    Directory
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)