private void initializeScheme(String p_uriSpec) throws MalformedURIException {
  int uriSpecLen=p_uriSpec.length();
  int index=0;
  String scheme=null;
  char testChar='\0';
  while (index < uriSpecLen) {
    testChar=p_uriSpec.charAt(index);
    if (testChar == ':' || testChar == '/' || testChar == '?' || testChar == '#') {
      break;
    }
    index++;
  }
  scheme=p_uriSpec.substring(0,index);
  if (scheme.length() == 0) {
    throw new MalformedURIException("No scheme found in URI.");
  }
 else {
    setScheme(scheme);
  }
}

private void initializeScheme ( String p_uriSpec ) throws MalformedURIException { int uriSpecLen = p_uriSpec . length ( ) ; int index = 0 ; String scheme = null ; char testChar = '\0' ; while ( index < uriSpecLen ) { testChar = p_uriSpec . charAt ( index ) ; if ( testChar == ':' || testChar == '/' || testChar == '?' || testChar == '#' ) { break ; } index ++ ; } scheme = p_uriSpec . substring ( 0 , index ) ; if ( scheme . length ( ) == 0 ) { throw new MalformedURIException ( "No scheme found in URI." ) ; } else { setScheme ( scheme ) ; } }
initialize the scheme for this uri from a uri string spec .
