Package org.apache.lucene.util
Class OfflineSorter.ByteSequencesReader
- java.lang.Object
-
- org.apache.lucene.util.OfflineSorter.ByteSequencesReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,BytesRefIterator
- Enclosing class:
- OfflineSorter
public static class OfflineSorter.ByteSequencesReader extends Object implements BytesRefIterator, Closeable
Utility class to read length-prefixed byte[] entries from an input. Complementary toOfflineSorter.ByteSequencesWriter.
-
-
Field Summary
Fields Modifier and Type Field Description protected longendprotected ChecksumIndexInputinprotected Stringnameprotected BytesRefBuilderref-
Fields inherited from interface org.apache.lucene.util.BytesRefIterator
EMPTY
-
-
Constructor Summary
Constructors Constructor Description ByteSequencesReader(ChecksumIndexInput in, String name)Constructs a ByteSequencesReader from the provided IndexInput
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the providedIndexInput.BytesRefnext()Reads the next entry into the providedBytesRef.
-
-
-
Field Detail
-
name
protected final String name
-
in
protected final ChecksumIndexInput in
-
end
protected final long end
-
ref
protected final BytesRefBuilder ref
-
-
Constructor Detail
-
ByteSequencesReader
public ByteSequencesReader(ChecksumIndexInput in, String name)
Constructs a ByteSequencesReader from the provided IndexInput
-
-
Method Detail
-
next
public BytesRef next() throws IOException
Reads the next entry into the providedBytesRef. The internal storage is resized if needed.- Specified by:
nextin interfaceBytesRefIterator- Returns:
- Returns
falseif EOF occurred when trying to read the header of the next sequence. Returnstrueotherwise. - Throws:
EOFException- if the file ends before the full sequence is read.IOException- If there is a low-level I/O error.
-
close
public void close() throws IOExceptionCloses the providedIndexInput.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-