code: public long getContentLength(MIMETypedStream stream) {
          long length = 0;
          if (stream.header != null) {
              for (int i = 0; i < stream.header.length; i++) {
                  if (stream.header[i].name != null
                          && !stream.header[i].name.equalsIgnoreCase("")
                          && stream.header[i].name.equalsIgnoreCase("content-length")) {
                      length = Long.parseLong(stream.header[i].value);
                      break;
                  }
              }
          }
          return length;
      }
docs: Returns the length of the content of this stream.
  @param stream the MIMETypedStream
  @return length the length of the content