code: private String checkPort(String uriAuthority)
      throws URIException {
  //        Matcher m = PORTREGEX.matcher(uriAuthority);
          Matcher m = TextUtils.getMatcher(PORTREGEX.pattern(), uriAuthority);
          if (m.matches()) {
              String no = m.group(2);
              if (no != null && no.length() > 0) {
                  // First check if the port has leading zeros
                  // as in '0080'.  Strip them if it has and
                  // then reconstitute the uriAuthority.  Be careful
                  // of cases where port is '0' or '000'.
                  while (no.charAt(0) == '0' && no.length() > 1) {
                      no = no.substring(1);
                  }
                  uriAuthority = m.group(1) + no;
                  // Now makesure the number is legit.
                  int portNo = 0;
                  try {
                      portNo = Integer.parseInt(no);
                  } catch (NumberFormatException nfe) {
                      // just catch and leave portNo at illegal 0
                  }
                  if (portNo <= 0 || portNo > 65535) {
                      throw new URIException("Port out of bounds: " +
                          uriAuthority);
                  }
              }
          }
          TextUtils.recycleMatcher(m); 
          return uriAuthority;
      }
docs: Check port on passed http authority.  Make sure the size is not larger
  than allowed: See the 'port' definition on this
  page, http://www.kerio.com/manual/wrp/en/418.htm.
  Also, we've seen port numbers of '0080' whose leading zeros confuse
  the parent class. Strip the leading zeros.
  
  @param uriAuthority
  @return Null or an amended port number.
  @throws URIException