def data_collector(iterable, def_buf_size=5242880):
    """ Buffers n bytes of data.

    :param iterable:
        Could be a list, generator or string
    :type iterable:
        List, generator, String

    :returns:
        A generator object
    """
    buf = b''
    for data in iterable:
        buf += data
        if len(buf) >= def_buf_size:
            output = buf[:def_buf_size]
            buf = buf[def_buf_size:]
            yield output
    if len(buf) > 0:
        yield buf