def decode_var_len_uint8(br):
    """Decodes a number in the range [0..255], by reading 1 - 11 bits"""
    if br.read_bits(1):
        nbits = br.read_bits(3)
        if nbits == 0:
            return 1
        return br.read_bits(nbits) + (1 << nbits)
    return 0