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 long
end
protected ChecksumIndexInput
in
protected String
name
protected BytesRefBuilder
ref
-
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 void
close()
Closes the providedIndexInput
.BytesRef
next()
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:
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
public void close() throws IOException
Closes the providedIndexInput
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-