def runLengthDecode(stream):
    """
        Method to decode streams using the Run-Length algorithm

        @param stream: A PDF stream
        @return: A tuple (status,statusContent), where statusContent is the decoded PDF stream in case status = 0 or an error in case status = -1
    """
    decodedStream = ''
    index = 0
    try:
        while index < len(stream):
            length = ord(stream[index])
            if length >= 0 and length < 128:
                decodedStream += stream[index + 1:index + length + 2]
                index += length + 2
            elif length > 128 and length < 256:
                decodedStream += stream[index + 1] * (257 - length)
                index += 2
            else:
                break
    except:
        return -1, 'Error decoding string'
    return 0, decodedStream
