private static byte findLongestExpansion(String uriString,int pos){
  byte expansion=-1;
  int expansionLength=0;
  for (int i=0; i < URL_CODES.size(); i++) {
    int key=URL_CODES.keyAt(i);
    String value=URL_CODES.valueAt(i);
    if (value.length() > expansionLength && uriString.startsWith(value,pos)) {
      expansion=(byte)key;
      expansionLength=value.length();
    }
  }
  return expansion;
}

private static byte findLongestExpansion ( String uriString , int pos ) { byte expansion = - 1 ; int expansionLength = 0 ; for ( int i = 0 ; i < URL_CODES . size ( ) ; i ++ ) { int key = URL_CODES . keyAt ( i ) ; String value = URL_CODES . valueAt ( i ) ; if ( value . length ( ) > expansionLength && uriString . startsWith ( value , pos ) ) { expansion = ( byte ) key ; expansionLength = value . length ( ) ; } } return expansion ; }
finds the longest expansion from the uri at the current position .
