def file_chunker(file, size=65536):
    """An iterator that reads a file in chunks."""
    read = file.read
    try:
        chunk = read(size)
        while chunk:
            yield chunk
            chunk = read(size)
    finally:
        file.close()
