org.apache.lucene.util.packed

Class DirectReader



  • public class DirectReader
    extends Object
    Retrieves an instance previously written by DirectWriter

    Example usage:

       int bitsPerValue = 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:
    DirectWriter
    • Method Detail

      • getInstance

        public static LongValues getInstance(RandomAccessInput slice,
                                             int bitsPerValue,
                                             long offset)
        Retrieves an instance from the specified offset of the given slice decoding bitsPerValue for each value