DirectWriter

Class for writing packed integers to be directly read from Directory. Integers can be read on-the-fly via DirectReader.

Unlike PackedInts, it optimizes for read i/o operations and supports > 2B values. Example usage:

int bitsPerValue = DirectWriter.bitsRequired(100); // values up to and including 100
IndexOutput output = dir.createOutput("packed", IOContext.DEFAULT);
DirectWriter writer = DirectWriter.getInstance(output, numberOfValues, bitsPerValue);
for (int i = 0; i < numberOfValues; i++) {
writer.add(value);
}
writer.finish();
output.close();
*

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
var count: Long
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var off: Int
Link copied to clipboard

Functions

Link copied to clipboard
fun add(l: Long)

Adds a value to this writer

Link copied to clipboard
fun finish()

finishes writing