@staticmethod
def decode_large_value(current_char, stream):
    """
        If we encounter a value larger than 127, we have to consume from the
        stram until we encounter a value below 127 and recombine them.

        See: https://msdn.microsoft.com/en-us/library/bb540809(v=vs.85).aspx
        """
    buffer = []
    while current_char > 127:
        buffer.append(current_char ^ 128)
        current_char = next(stream)
    total = current_char
    for i, digit in enumerate(reversed(buffer)):
        total += digit * 128 ** (i + 1)
    return total
