public int nextSetBit() {
        if (indexArray == 0) {
            if (word != 0) {
                word >>>= 8;
                wordShift += 8;
            }

            while (word == 0) {
                if (++i >= wlen) {
                    return NO_MORE;
                }
                word = MemoryUtil.getLong(bitsAddr + (i << 3));
                wordShift = -1; // loop invariant code motion should move this
            }

            // after the first time, should I go with a linear search, or
            // stick with the binary search in shift?
            shift();
        }

        int bitIndex = (indexArray & 0x0f) + wordShift;
        indexArray >>>= 4;
        // should i<<6 be cached as a separate variable?
        // it would only save one cycle in the best circumstances.
        return (i << 6) + bitIndex;
    }
** the python code that generated bitlist
     def bits2int(val):
     arr=0
     for shift in range(8,0,-1):
     if val & 0x80:
     arr = (arr << 4) | shift
     val = val << 1
     return arr

     def int_table():
     tbl = [ hex(bits2int(val)).strip('L') for val in range(256) ]
     return ','.join(tbl)
****
indexr-common/src/main/java/io/indexr/util/DirectBitMapIterator.java