code: public int getContentLength() {
          try {
              getInputStream();
          } catch (Exception e) {
              return -1;
          }
          int l = contentLength;
          if (l < 0) {
              try {
                  l = Integer.parseInt(properties.findValue("content-length"));
                  setContentLength(l);
              } catch(Exception e) {
              }
          }
          return l;
      }
docs: Call this routine to get the content-length associated with this
  object.