Package org.apache.lucene.util.packed
Class DirectReader
java.lang.Object
org.apache.lucene.util.packed.DirectReader
Retrieves an instance previously written by
DirectWriter
Example usage:
int bitsPerValue = DirectWriter.bitsRequired(100);
IndexInput in = dir.openInput("packed", IOContext.DEFAULT);
LongValues values = DirectReader.getInstance(in.randomAccessSlice(start, end), bitsPerValue);
for (int i = 0; i < numValues; i++) {
long value = values.get(i);
}
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LongValuesgetInstance(RandomAccessInput slice, int bitsPerValue) Retrieves an instance from the specified slice written decodingbitsPerValuefor each valuestatic LongValuesgetInstance(RandomAccessInput slice, int bitsPerValue, long offset) Retrieves an instance from the specifiedoffsetof the given slice decodingbitsPerValuefor each valuestatic LongValuesgetMergeInstance(RandomAccessInput slice, int bitsPerValue, long numValues) Retrieves an instance that is specialized for merges and is typically faster at sequential access but slower at random access.static LongValuesgetMergeInstance(RandomAccessInput slice, int bitsPerValue, long baseOffset, long numValues) Retrieves an instance that is specialized for merges and is typically faster at sequential access.
-
Constructor Details
-
DirectReader
public DirectReader()
-
-
Method Details
-
getInstance
Retrieves an instance from the specified slice written decodingbitsPerValuefor each value -
getInstance
Retrieves an instance from the specifiedoffsetof the given slice decodingbitsPerValuefor each value -
getMergeInstance
public static LongValues getMergeInstance(RandomAccessInput slice, int bitsPerValue, long numValues) Retrieves an instance that is specialized for merges and is typically faster at sequential access but slower at random access. -
getMergeInstance
public static LongValues getMergeInstance(RandomAccessInput slice, int bitsPerValue, long baseOffset, long numValues) Retrieves an instance that is specialized for merges and is typically faster at sequential access.
-