Here you can find the source of decodeIndex(final BitSet bs, final long rangePerDimension)
private static long decodeIndex(final BitSet bs, final long rangePerDimension)
//package com.java2s; //License from project: Apache License import java.util.BitSet; public class Main { private static long decodeIndex(final BitSet bs, final long rangePerDimension) { long floor = 0; long ceiling = rangePerDimension; long mid = 0; for (int i = 0; i < bs.length(); i++) { mid = (floor + ceiling) / 2; if (bs.get(i)) { floor = mid;/*from w w w . j a v a2 s . co m*/ } else { ceiling = mid; } } return mid; } }