code: public long getResponseContentLength() {
          Header[] headers = getResponseHeaderGroup().getHeaders("Content-Length");
          if (headers.length == 0) {
              return -1;
          }
          if (headers.length > 1) {
              LOG.warn("Multiple content-length headers detected");
          }
          for (int i = headers.length - 1; i >= 0; i--) {
              Header header = headers[i];
              try {
                  return Long.parseLong(header.getValue());
              } catch (NumberFormatException e) {
                  if (LOG.isWarnEnabled()) {
                      LOG.warn("Invalid content-length value: " + e.getMessage());
                  }
              }
              // See if we can have better luck with another header, if present
          }
          return -1;
      }
docs: Return the length (in bytes) of the response body, as specified in a
  <tt>Content-Length</tt> header.
  
  <p>
  Return <tt>-1</tt> when the content-length is unknown.
  </p>
  
  @return content length, if <tt>Content-Length</tt> header is available.
  <tt>0</tt> indicates that the request has no body.
  If <tt>Content-Length</tt> header is not present, the method
  returns  <tt>-1</tt>.