private void fillBuffer() {
        while (bits < 24) {
            if (idx++ < idxMax) {
                b |= (ab[idx] & 0xff) << bits;
            }
            bits += 8;
        }
    }
decode an integer in the range 0..max (inclusive).

@see #encodeBounded
main/src/main/java/cgeo/geocaching/brouter/util/BitCoderContext.java