@staticmethod
def value_from_buffer(bfr):
    """ Parse an extensible byte serialised unsigned int from a buffer.

        Continuation octets have their high bit set.
        The value is big-endian.

        This is the go for reading from a stream. If you already have
        a bare bytes instance then `cs.serialise.get_uint` may be better.
    """
    n = 0
    b = 128
    while b & 128:
        bs = bfr.take(1)
        b = bs[0]
        n = n << 7 | b & 127
    return n
