Package org.apache.lucene.search.suggest
Class Sort.ByteSequencesReader
java.lang.Object
org.apache.lucene.search.suggest.Sort.ByteSequencesReader
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
Sort
Utility class to read length-prefixed byte[] entries from an input.
Complementary to
Sort.ByteSequencesWriter.-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a ByteSequencesReader from the provided DataInputByteSequencesReader(File file) Constructs a ByteSequencesReader from the provided File -
Method Summary
-
Constructor Details
-
ByteSequencesReader
Constructs a ByteSequencesReader from the provided File- Throws:
IOException
-
ByteSequencesReader
Constructs a ByteSequencesReader from the provided DataInput
-
-
Method Details
-
read
Reads the next entry into the providedBytesRef. The internal storage is resized if needed.- 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
-
read
Reads the next entry and returns it if successful.- Returns:
- Returns
nullif EOF occurred before the next entry could be read. - Throws:
EOFException- if the file ends before the full sequence is read.IOException- See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-