def _bencode_read_string(f):
    """Read a Bencoded byte string from current position of f."""
    length = 0
    s = f.read(1)
    while s != b':':
        if not s.isdigit():
            raise ValueError('Length of string expected but %s found.' % s)
        length = length * 10 + int(s.decode())
        s = f.read(1)
    if length == 0:
        raise ValueError("Length of string expected but ':' found.")
    return f.read(length).decode()