public final int decodeBits(final int count) {
        fillBuffer();
        final int mask = 0xffffffff >>> (32 - count);
        final int value = b & mask;
        b >>>= count;
        bits -= count;
        return value;
    }
decode an integer in the range 0..max (inclusive).

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