Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class BufferedIndexInput

    Base implementation class for buffered IndexInput.

    Inheritance
    object
    DataInput
    IndexInput
    BufferedIndexInput
    NIOFSDirectory.NIOFSIndexInput
    SimpleFSDirectory.SimpleFSIndexInput
    Implements
    IDisposable
    Inherited Members
    IndexInput.Dispose()
    IndexInput.Dispose(bool)
    IndexInput.Length
    IndexInput.ToString()
    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 BufferedIndexInput : IndexInput, IDisposable

    Constructors

    BufferedIndexInput(string)

    Base implementation class for buffered IndexInput.

    Declaration
    protected BufferedIndexInput(string resourceDesc)
    Parameters
    Type Name Description
    string resourceDesc

    BufferedIndexInput(string, IOContext)

    Base implementation class for buffered IndexInput.

    Declaration
    protected BufferedIndexInput(string resourceDesc, IOContext context)
    Parameters
    Type Name Description
    string resourceDesc
    IOContext context

    BufferedIndexInput(string, int)

    Inits BufferedIndexInput with a specific bufferSize

    Declaration
    protected BufferedIndexInput(string resourceDesc, int bufferSize)
    Parameters
    Type Name Description
    string resourceDesc
    int bufferSize

    Fields

    BUFFER_SIZE

    Default buffer size set to BUFFER_SIZE.

    Declaration
    public const int BUFFER_SIZE = 1024
    Field Value
    Type Description
    int

    MERGE_BUFFER_SIZE

    A buffer size for merges set to MERGE_BUFFER_SIZE.

    Declaration
    public const int MERGE_BUFFER_SIZE = 4096
    Field Value
    Type Description
    int

    m_buffer

    Base implementation class for buffered IndexInput.

    Declaration
    protected byte[] m_buffer
    Field Value
    Type Description
    byte[]

    Properties

    BufferSize

    Returns buffer size.

    Declaration
    public int BufferSize { get; }
    Property Value
    Type Description
    int
    See Also
    SetBufferSize(int)

    Position

    Returns the current position in this file, where the next read will occur.

    This was getFilePointer() in Lucene.
    Declaration
    public override sealed long Position { get; }
    Property Value
    Type Description
    long
    Overrides
    IndexInput.Position
    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
    IndexInput.Clone()

    FlushBuffer(IndexOutput, long)

    Flushes the in-memory buffer to the given output, copying at most numBytes.

    NOTE: this method does not refill the buffer, however it does advance the buffer position.
    Declaration
    protected int FlushBuffer(IndexOutput @out, long numBytes)
    Parameters
    Type Name Description
    IndexOutput out
    long numBytes
    Returns
    Type Description
    int

    the number of bytes actually flushed from the in-memory buffer.

    GetBufferSize(IOContext)

    Returns default buffer sizes for the given IOContext

    Declaration
    public static int GetBufferSize(IOContext context)
    Parameters
    Type Name Description
    IOContext context
    Returns
    Type Description
    int

    NewBuffer(byte[])

    Base implementation class for buffered IndexInput.

    Declaration
    protected virtual void NewBuffer(byte[] newBuffer)
    Parameters
    Type Name Description
    byte[] newBuffer

    ReadByte()

    Reads and returns a single byte.

    Declaration
    public override sealed byte ReadByte()
    Returns
    Type Description
    byte
    Overrides
    DataInput.ReadByte()
    See Also
    WriteByte(byte)

    ReadBytes(byte[], int, int)

    Reads a specified number of bytes into an array at the specified offset.

    Declaration
    public override sealed void ReadBytes(byte[] b, int offset, int len)
    Parameters
    Type Name Description
    byte[] b

    the array to read bytes into

    int offset

    the offset in the array to start storing bytes

    int len

    the number of bytes to read

    Overrides
    DataInput.ReadBytes(byte[], int, int)
    See Also
    WriteBytes(byte[], int)

    ReadBytes(byte[], int, int, bool)

    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.

    Declaration
    public override sealed void ReadBytes(byte[] b, int offset, int len, bool useBuffer)
    Parameters
    Type Name Description
    byte[] b

    the array to read bytes into

    int offset

    the offset in the array to start storing bytes

    int len

    the number of bytes to read

    bool useBuffer

    set to false if the caller will handle buffering.

    Overrides
    DataInput.ReadBytes(byte[], int, int, bool)
    See Also
    WriteBytes(byte[], int)

    ReadInt16()

    NOTE: this was readShort() in Lucene

    Declaration
    public override sealed short ReadInt16()
    Returns
    Type Description
    short
    Overrides
    DataInput.ReadInt16()

    ReadInt32()

    NOTE: this was readInt() in Lucene

    Declaration
    public override sealed int ReadInt32()
    Returns
    Type Description
    int
    Overrides
    DataInput.ReadInt32()

    ReadInt64()

    NOTE: this was readLong() in Lucene

    Declaration
    public override sealed long ReadInt64()
    Returns
    Type Description
    long
    Overrides
    DataInput.ReadInt64()

    ReadInternal(byte[], int, int)

    Expert: implements buffer refill. Reads bytes from the current position in the input.

    Declaration
    protected abstract void ReadInternal(byte[] b, int offset, int length)
    Parameters
    Type Name Description
    byte[] b

    the array to read bytes into

    int offset

    the offset in the array to start storing bytes

    int length

    the number of bytes to read

    ReadVInt32()

    NOTE: this was readVInt() in Lucene

    Declaration
    public override sealed int ReadVInt32()
    Returns
    Type Description
    int
    Overrides
    DataInput.ReadVInt32()

    ReadVInt64()

    NOTE: this was readVLong() in Lucene

    Declaration
    public override sealed long ReadVInt64()
    Returns
    Type Description
    long
    Overrides
    DataInput.ReadVInt64()

    Seek(long)

    Sets current position in this file, where the next read will occur.

    Declaration
    public override sealed void Seek(long pos)
    Parameters
    Type Name Description
    long pos
    Overrides
    IndexInput.Seek(long)
    See Also
    Position

    SeekInternal(long)

    Expert: implements seek. Sets current position in this file, where the next ReadInternal(byte[], int, int) will occur.

    Declaration
    protected abstract void SeekInternal(long pos)
    Parameters
    Type Name Description
    long pos
    See Also
    ReadInternal(byte[], int, int)

    SetBufferSize(int)

    Change the buffer size used by this IndexInput

    Declaration
    public void SetBufferSize(int newSize)
    Parameters
    Type Name Description
    int newSize

    Implements

    IDisposable
    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.