Part of libcloud.utils View Source
Function | read_in_chunks | Return a generator which yields data in chunks. |
Function | exhaust_iterator | Exhaust an iterator and return all data returned by it. |
Function | guess_file_mime_type | Undocumented |
Return a generator which yields data in chunks. @type iterator: C{Iterator} @param response: An object which implements an iterator interface or a File like object with read method. @type chunk_size: C{int} @param chunk_size: Optional chunk size (defaults to CHUNK_SIZE) @type fill_size: C{bool} @param fill_size: If True, make sure chunks are chunk_size in length (except for last chunk). TODO: At some point in the future we could use byte arrays here if version >= Python 3. This should speed things up a bit and reduce memory usage.
Exhaust an iterator and return all data returned by it. @type iterator: C{Iterator} @param response: An object which implements an iterator interface or a File like object with read method. @rtype C{str} @return Data returned by the iterator.