Class PackedInts.Reader

    • Constructor Summary

      Constructors 
      Constructor Description
      Reader()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int get​(int index, long[] arr, int off, int len)
      Bulk get: read at least one and at most len longs starting from index into arr[off:off+len] and return the actual number of values that have been read.
      java.lang.Object getArray()
      Expert: if the bit-width of this reader matches one of java's native types, returns the underlying array (ie, byte[], short[], int[], long[]); else, returns null.
      abstract int getBitsPerValue()  
      boolean hasArray()
      Returns true if this implementation is backed by a native java array.
      abstract long ramBytesUsed()
      Return the in-memory size in bytes.
      abstract int size()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Reader

        public Reader()
    • Method Detail

      • get

        public int get​(int index,
                       long[] arr,
                       int off,
                       int len)
        Bulk get: read at least one and at most len longs starting from index into arr[off:off+len] and return the actual number of values that have been read.
      • getBitsPerValue

        public abstract int getBitsPerValue()
        Returns:
        the number of bits used to store any given value. Note: This does not imply that memory usage is bitsPerValue * #values as implementations are free to use non-space-optimal packing of bits.
      • size

        public abstract int size()
        Returns:
        the number of values.
      • ramBytesUsed

        public abstract long ramBytesUsed()
        Return the in-memory size in bytes.
      • getArray

        public java.lang.Object getArray()
        Expert: if the bit-width of this reader matches one of java's native types, returns the underlying array (ie, byte[], short[], int[], long[]); else, returns null. Note that when accessing the array you must upgrade the type (bitwise AND with all ones), to interpret the full value as unsigned. Ie, bytes[idx]&0xFF, shorts[idx]&0xFFFF, etc.
      • hasArray

        public boolean hasArray()
        Returns true if this implementation is backed by a native java array.
        See Also:
        getArray()