def copyStreamToStream(streamFrom, streamTo, input_length=sys.maxint, offset=0,
                        buffer=2 ** 2 ** 2 ** 2):
    """ Copy contents of one stream into another. """
    streamFrom.seek(offset, 0)
    nbytes = 0
    while  nbytes < input_length:
                chunk = streamFrom.read(min(input_length - nbytes, buffer))
                if not chunk:
                    break
                streamTo.write(chunk)
                nbytes += len(chunk)
dataset/ETHPy150Open livenson/vcdm/src/vcdm/utils.py/copyStreamToStream/original