int getContentLength(HttpURLConnection conn) {
    String transferEncoding = conn.getHeaderField(TRANSFER_ENCODING);
    if (transferEncoding == null || transferEncoding.equalsIgnoreCase("chunked")) {
      return conn.getHeaderFieldInt(CONTENT_LENGTH, -1);
    } else {
      return -1;
    }
  }
int getContentLength ( HttpURLConnection conn ) { String transferEncoding = conn . getHeaderField ( TRANSFER_ENCODING ) ; if ( transferEncoding == null || transferEncoding . equalsIgnoreCase ( "chunked" ) ) { return conn . getHeaderFieldInt ( CONTENT_LENGTH , - 1 ) ; } else { return - 1 ; } }
/* read response content length from server