private int scanData(String data,StringBuffer schemeData,int endOffset,int currentOffset){
  while (true) {
    if (currentOffset == endOffset) {
      break;
    }
    int ch=data.charAt(currentOffset);
    byte chartype=(ch >= 0x80) ? CHARTYPE_NONASCII : fASCIICharMap[ch];
    if (chartype == CHARTYPE_OPEN_PAREN) {
      schemeData.append(ch);
      currentOffset=scanData(data,schemeData,endOffset,++currentOffset);
      if (currentOffset == endOffset) {
        return currentOffset;
      }
      ch=data.charAt(currentOffset);
      chartype=(ch >= 0x80) ? CHARTYPE_NONASCII : fASCIICharMap[ch];
      if (chartype != CHARTYPE_CLOSE_PAREN) {
        return endOffset;
      }
      schemeData.append((char)ch);
      ++currentOffset;
    }
 else     if (chartype == CHARTYPE_CLOSE_PAREN) {
      return currentOffset;
    }
 else     if (chartype == CHARTYPE_CARRET) {
      ch=data.charAt(++currentOffset);
      chartype=(ch >= 0x80) ? CHARTYPE_NONASCII : fASCIICharMap[ch];
      if (chartype != CHARTYPE_CARRET && chartype != CHARTYPE_OPEN_PAREN && chartype != CHARTYPE_CLOSE_PAREN) {
        break;
      }
      schemeData.append((char)ch);
      ++currentOffset;
    }
 else {
      schemeData.append((char)ch);
      ++currentOffset;
    }
  }
  return currentOffset;
}

private int scanData ( String data , StringBuffer schemeData , int endOffset , int currentOffset ) { while ( true ) { if ( currentOffset == endOffset ) { break ; } int ch = data . charAt ( currentOffset ) ; byte chartype = ( ch >= 0x80 ) ? CHARTYPE_NONASCII : fASCIICharMap [ ch ] ; if ( chartype == CHARTYPE_OPEN_PAREN ) { schemeData . append ( ch ) ; currentOffset = scanData ( data , schemeData , endOffset , ++ currentOffset ) ; if ( currentOffset == endOffset ) { return currentOffset ; } ch = data . charAt ( currentOffset ) ; chartype = ( ch >= 0x80 ) ? CHARTYPE_NONASCII : fASCIICharMap [ ch ] ; if ( chartype != CHARTYPE_CLOSE_PAREN ) { return endOffset ; } schemeData . append ( ( char ) ch ) ; ++ currentOffset ; } else if ( chartype == CHARTYPE_CLOSE_PAREN ) { return currentOffset ; } else if ( chartype == CHARTYPE_CARRET ) { ch = data . charAt ( ++ currentOffset ) ; chartype = ( ch >= 0x80 ) ? CHARTYPE_NONASCII : fASCIICharMap [ ch ] ; if ( chartype != CHARTYPE_CARRET && chartype != CHARTYPE_OPEN_PAREN && chartype != CHARTYPE_CLOSE_PAREN ) { break ; } schemeData . append ( ( char ) ch ) ; ++ currentOffset ; } else { schemeData . append ( ( char ) ch ) ; ++ currentOffset ; } } return currentOffset ; }
scans the schemedata . [ 6 ] schemedata : : = escapeddata [ 7 ] escapeddata : : = normalchar | ' ^ ( ' | ' ^ ) ' | ' ^ ^ ' | ' ( ' schemedata ' ) ' [ 8 ] normalchar : : = unicodechar - [ ( ) ^ ] [ 9 ] unicodechar : : = [ # x0 - # x10ffff ]
