Show / Hide Table of Contents

    Class DataInput

    Abstract base class for performing read operations of Lucene's low-level data types.

    DataInput 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 DataInput instance must be cloned before used in another thread. Subclasses must therefore implement Clone(), returning a new DataInput which operates on the same underlying resource, but positioned independently.

    Inheritance
    System.Object
    DataInput
    ByteSliceReader
    ByteArrayDataInput
    IndexInput
    InputStreamDataInput
    BinaryReaderDataInput
    FST.BytesReader
    PagedBytes.PagedBytesDataInput
    Namespace: Lucene.Net.Store
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class DataInput : object

    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.

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

    ReadByte()

    Reads and returns a single byte.

    Declaration
    public abstract byte ReadByte()
    Returns
    Type Description
    System.Byte
    See Also
    WriteByte(System.Byte)
    | Improve this Doc View Source

    ReadBytes(Byte[], Int32, Int32)

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

    Declaration
    public abstract void ReadBytes(byte[] b, int offset, int len)
    Parameters
    Type Name Description
    System.Byte[] b

    the array to read bytes into

    System.Int32 offset

    the offset in the array to start storing bytes

    System.Int32 len

    the number of bytes to read

    See Also
    WriteBytes(System.Byte[], System.Int32)
    | Improve this Doc View Source

    ReadBytes(Byte[], Int32, Int32, Boolean)

    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 virtual void ReadBytes(byte[] b, int offset, int len, bool useBuffer)
    Parameters
    Type Name Description
    System.Byte[] b

    the array to read bytes into

    System.Int32 offset

    the offset in the array to start storing bytes

    System.Int32 len

    the number of bytes to read

    System.Boolean useBuffer

    set to false if the caller will handle buffering.

    See Also
    WriteBytes(System.Byte[], System.Int32)
    | Improve this Doc View Source

    ReadInt16()

    Reads two bytes and returns a .

    LUCENENET NOTE: Important - always cast to ushort (System.UInt16) before using to ensure the value is positive!

    NOTE: this was readShort() in Lucene

    Declaration
    public virtual short ReadInt16()
    Returns
    Type Description
    System.Int16
    See Also
    WriteInt16(System.Int16)
    | Improve this Doc View Source

    ReadInt32()

    Reads four bytes and returns an .

    NOTE: this was readInt() in Lucene

    Declaration
    public virtual int ReadInt32()
    Returns
    Type Description
    System.Int32
    See Also
    WriteInt32(System.Int32)
    | Improve this Doc View Source

    ReadInt64()

    Reads eight bytes and returns a .

    NOTE: this was readLong() in Lucene

    Declaration
    public virtual long ReadInt64()
    Returns
    Type Description
    System.Int64
    See Also
    WriteInt64(System.Int64)
    | Improve this Doc View Source

    ReadString()

    Reads a .

    Declaration
    public virtual string ReadString()
    Returns
    Type Description
    System.String
    See Also
    WriteString(System.String)
    | Improve this Doc View Source

    ReadStringSet()

    Reads a ISet<string> previously written with WriteStringSet(ISet<String>).

    Declaration
    public virtual ISet<string> ReadStringSet()
    Returns
    Type Description
    ISet<System.String>
    | Improve this Doc View Source

    ReadStringStringMap()

    Reads a IDictionary<string,string> previously written with WriteStringStringMap(IDictionary<String, String>).

    Declaration
    public virtual IDictionary<string, string> ReadStringStringMap()
    Returns
    Type Description
    IDictionary<System.String, System.String>
    | Improve this Doc View Source

    ReadVInt32()

    Reads an stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

    The format is described further in WriteVInt32(Int32).

    NOTE: this was readVInt() in Lucene

    Declaration
    public virtual int ReadVInt32()
    Returns
    Type Description
    System.Int32
    See Also
    WriteVInt32(System.Int32)
    | Improve this Doc View Source

    ReadVInt64()

    Reads a stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

    The format is described further in WriteVInt32(Int32).

    NOTE: this was readVLong() in Lucene

    Declaration
    public virtual long ReadVInt64()
    Returns
    Type Description
    System.Int64
    See Also
    WriteVInt64(System.Int64)
    | Improve this Doc View Source

    SkipBytes(Int64)

    Skip over numBytes bytes. The contract on this method is that it should have the same behavior as reading the same number of bytes into a buffer and discarding its content. Negative values of numBytes are not supported.

    Declaration
    public virtual void SkipBytes(long numBytes)
    Parameters
    Type Name Description
    System.Int64 numBytes
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)