'Calculates the response size.
May be overriden to support different types of response.
Args:
res: A urllib2.Response.
Returns:
the size of the response, in bytes.'

def _CalculateResponseSize(self, res):

    content = res.read()
    def ReturnContent():
        return content
    res.read = ReturnContent
    return (len(content) + self._CalculateHeaderSize(dict(res.info().items())))
