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 to
OfflineSorter.ByteSequencesWriter
.-
Field Summary
Modifier and TypeFieldDescriptionprotected final long
protected final ChecksumIndexInput
protected final String
Fields inherited from interface org.apache.lucene.util.BytesRefIterator
EMPTY
-
Constructor Summary
ConstructorDescriptionByteSequencesReader
(ChecksumIndexInput in, String name) Constructs a ByteSequencesReader from the provided IndexInput -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the providedIndexInput
.next()
Reads the next entry into the providedBytesRef
.
-
Field Details
-
name
-
in
-
end
protected final long end
-
-
Constructor Details
-
ByteSequencesReader
Constructs a ByteSequencesReader from the provided IndexInput
-
-
Method Details
-
next
Reads the next entry into the providedBytesRef
. The internal storage is resized if needed.- Specified by:
next
in interfaceBytesRefIterator
- Returns:
- Returns
false
if EOF occurred when trying to read the header of the next sequence. Returnstrue
otherwise. - Throws:
EOFException
- if the file ends before the full sequence is read.IOException
- If there is a low-level I/O error.
-
close
Closes the providedIndexInput
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-