def _size(headers):
    """Get size of a remote file in bytes by parsing the HTTP headers.
    Returns 0 if the information is not available.
    """
    if 'x-goog-stored-content-length' in headers:
        length = headers['x-goog-stored-content-length']
    elif 'Content-Length' in headers:
        length = headers['Content-Length']
    else:
        length = 0
    return int(length)