public final void encodeVarBits2(int value) {
        int range = 0;
        while (value > range) {
            encodeBit(false);
            value -= range + 1;
            range = 2 * range + 1;
        }
        encodeBit(true);
        encodeBounded(range, value);
    }
encode a distance with a variable bit length
(poor mans huffman tree)
{@code 1 -> 0}
{@code 01 -> 1} + following 1-bit word ( 1..2 )
{@code 001 -> 3} + following 2-bit word ( 3..6 )
{@code 0001 -> 7} + following 3-bit word ( 7..14 ) etc.

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