Class OfflineSorter.ByteSequencesReader
Utility class to read length-prefixed byte[] entries from an input. Complementary to OfflineSorter.ByteSequencesWriter.
Implements
Inherited Members
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 thereader
'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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | If the file ends before the full sequence is read. |
See Also
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 |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | If the file ends before the full sequence is read. |
ArgumentNullException |
|