Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ByteBufferIndexInput

    Base IndexInput implementation that uses an array of J2N.IO.ByteBuffers to represent a file.

    Because Java's J2N.IO.ByteBuffer uses an int to address the values, it's necessary to access a file greater MaxValue in size using multiple byte buffers.

    For efficiency, this class requires that the buffers are a power-of-two (chunkSizePower).
    Inheritance
    object
    DataInput
    IndexInput
    ByteBufferIndexInput
    MMapDirectory.MMapIndexInput
    Implements
    IDisposable
    Inherited Members
    IndexInput.Dispose()
    DataInput.ReadBytes(byte[], int, int, bool)
    DataInput.ReadVInt32()
    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 ByteBufferIndexInput : IndexInput, IDisposable

    Properties

    Length

    The number of bytes in the file.

    Declaration
    public override sealed long Length { get; }
    Property Value
    Type Description
    long
    Overrides
    IndexInput.Length

    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 sealed object Clone()
    Returns
    Type Description
    object
    Overrides
    IndexInput.Clone()

    Dispose(bool)

    Closes the stream to further operations.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    IndexInput.Dispose(bool)

    FreeBuffer(ByteBuffer)

    Called when the contents of a buffer will be no longer needed.

    Declaration
    protected abstract void FreeBuffer(ByteBuffer b)
    Parameters
    Type Name Description
    ByteBuffer b

    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)

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

    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

    Slice(string, long, long)

    Creates a slice of this index input, with the given description, offset, and length. The slice is seeked to the beginning.

    Declaration
    public ByteBufferIndexInput Slice(string sliceDescription, long offset, long length)
    Parameters
    Type Name Description
    string sliceDescription
    long offset
    long length
    Returns
    Type Description
    ByteBufferIndexInput

    ToString()

    Returns the resourceDescription that was passed into the constructor.

    Declaration
    public override sealed string ToString()
    Returns
    Type Description
    string
    Overrides
    IndexInput.ToString()

    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.