Class OfflineSorter.ByteSequencesWriter
Utility class to emit length-prefixed byte[] entries to an output stream for sorting. Complementary to OfflineSorter.ByteSequencesReader.
Implements
Inherited Members
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public class OfflineSorter.ByteSequencesWriter : IDisposable
Constructors
ByteSequencesWriter(BinaryWriter)
Constructs a OfflineSorter.ByteSequencesWriter to the provided BinaryWriter.
NOTE: To match Lucene, pass the writer
's constructor the
DEFAULT_ENCODING, which is UTF-8 without a byte order mark.
Declaration
public ByteSequencesWriter(BinaryWriter writer)
Parameters
Type | Name | Description |
---|---|---|
BinaryWriter | writer |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ByteSequencesWriter(FileInfo)
Constructs a OfflineSorter.ByteSequencesWriter to the provided FileInfo.
Declaration
public ByteSequencesWriter(FileInfo file)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | file |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ByteSequencesWriter(FileStream)
Constructs a OfflineSorter.ByteSequencesWriter to the provided FileStream.
Declaration
public ByteSequencesWriter(FileStream stream)
Parameters
Type | Name | Description |
---|---|---|
FileStream | stream |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ByteSequencesWriter(FileStream, bool)
Constructs a OfflineSorter.ByteSequencesWriter to the provided FileStream.
Declaration
public ByteSequencesWriter(FileStream stream, bool leaveOpen)
Parameters
Type | Name | Description |
---|---|---|
FileStream | stream | |
bool | leaveOpen |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ByteSequencesWriter(string)
Constructs a OfflineSorter.ByteSequencesWriter to the provided file path.
Declaration
public ByteSequencesWriter(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Methods
Dispose()
Disposes the provided DataOutput if it is IDisposable.
Declaration
public void Dispose()
Dispose(bool)
Disposes the provided DataOutput if it is IDisposable.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
Write(BytesRef)
Writes a BytesRef.
Declaration
public virtual void Write(BytesRef @ref)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | ref |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
Write(byte[])
Writes a byte array.
Declaration
public virtual void Write(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
See Also
Write(byte[], int, int)
Writes a byte array.
The length is written as a short, followed by the bytes.Declaration
public virtual void Write(byte[] bytes, int off, int len)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes | |
int | off | |
int | len |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException |
|