Package org.apache.lucene.util
Class OfflineSorter.ByteSequencesWriter
- java.lang.Object
-
- org.apache.lucene.util.OfflineSorter.ByteSequencesWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- OfflineSorter
public static class OfflineSorter.ByteSequencesWriter extends java.lang.Object implements java.io.CloseableUtility class to emit length-prefixed byte[] entries to an output stream for sorting. Complementary toOfflineSorter.ByteSequencesReader. You must useCodecUtil.writeFooter(org.apache.lucene.store.IndexOutput)to write a footer at the end of the input file.
-
-
Field Summary
Fields Modifier and Type Field Description protected IndexOutputout
-
Constructor Summary
Constructors Constructor Description ByteSequencesWriter(IndexOutput out)Constructs a ByteSequencesWriter to the provided DataOutput
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the providedIndexOutput.voidwrite(byte[] bytes)Writes a byte array.voidwrite(byte[] bytes, int off, int len)Writes a byte array.voidwrite(BytesRef ref)Writes a BytesRef.
-
-
-
Field Detail
-
out
protected final IndexOutput out
-
-
Constructor Detail
-
ByteSequencesWriter
public ByteSequencesWriter(IndexOutput out)
Constructs a ByteSequencesWriter to the provided DataOutput
-
-
Method Detail
-
write
public final void write(BytesRef ref) throws java.io.IOException
Writes a BytesRef.- Throws:
java.io.IOException- See Also:
write(byte[], int, int)
-
write
public final void write(byte[] bytes) throws java.io.IOExceptionWrites a byte array.- Throws:
java.io.IOException- See Also:
write(byte[], int, int)
-
write
public void write(byte[] bytes, int off, int len) throws java.io.IOExceptionWrites a byte array.The length is written as a
short, followed by the bytes.- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionCloses the providedIndexOutput.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-