Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class OfflineSorter.ByteSequencesReader

    Utility class to read length-prefixed byte[] entries from an input. Complementary to OfflineSorter.ByteSequencesWriter.

    Inheritance
    object
    OfflineSorter.ByteSequencesReader
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public class OfflineSorter.ByteSequencesReader : IDisposable

    Constructors

    ByteSequencesReader(BinaryReader)

    Constructs a OfflineSorter.ByteSequencesReader from the provided BinaryReader.

    NOTE: To match Lucene, pass the reader's constructor the DEFAULT_ENCODING, which is UTF-8 without a byte order mark.
    Declaration
    public ByteSequencesReader(BinaryReader reader)
    Parameters
    Type Name Description
    BinaryReader reader
    Exceptions
    Type Condition
    ArgumentNullException

    reader is null.

    ByteSequencesReader(FileInfo)

    Constructs a OfflineSorter.ByteSequencesReader from the provided file.

    Declaration
    public ByteSequencesReader(FileInfo file)
    Parameters
    Type Name Description
    FileInfo file
    Exceptions
    Type Condition
    ArgumentException

    file is null or whitespace.

    ByteSequencesReader(FileStream)

    Constructs a OfflineSorter.ByteSequencesReader from the provided FileStream.

    Declaration
    public ByteSequencesReader(FileStream stream)
    Parameters
    Type Name Description
    FileStream stream
    Exceptions
    Type Condition
    ArgumentNullException

    stream is null.

    ByteSequencesReader(FileStream, bool)

    Constructs a OfflineSorter.ByteSequencesReader from the provided FileStream.

    Declaration
    public ByteSequencesReader(FileStream stream, bool leaveOpen)
    Parameters
    Type Name Description
    FileStream stream
    bool leaveOpen
    Exceptions
    Type Condition
    ArgumentNullException

    stream is null.

    ByteSequencesReader(string)

    Constructs a OfflineSorter.ByteSequencesReader from the provided path.

    Declaration
    public ByteSequencesReader(string path)
    Parameters
    Type Name Description
    string path
    Exceptions
    Type Condition
    ArgumentException

    path is null or whitespace.

    Methods

    Dispose()

    Disposes the provided DataInput if it is IDisposable.

    Declaration
    public void Dispose()

    Dispose(bool)

    Utility class to read length-prefixed byte[] entries from an input. Complementary to OfflineSorter.ByteSequencesWriter.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    Read()

    Reads the next entry and returns it if successful.

    Declaration
    public virtual byte[]? Read()
    Returns
    Type Description
    byte[]

    Returns null if EOF occurred before the next entry could be read.

    Exceptions
    Type Condition
    EndOfStreamException

    If the file ends before the full sequence is read.

    See Also
    Read(BytesRef)

    Read(BytesRef)

    Reads the next entry into the provided BytesRef. The internal storage is resized if needed.

    Declaration
    public virtual bool Read(BytesRef @ref)
    Parameters
    Type Name Description
    BytesRef ref
    Returns
    Type Description
    bool

    Returns false if EOF occurred when trying to read the header of the next sequence. Returns true otherwise.

    Exceptions
    Type Condition
    EndOfStreamException

    If the file ends before the full sequence is read.

    ArgumentNullException

    ref is null.

    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.