private static void map(final StringBuilder buffer,final ByteSequence sequence,final boolean trim,final boolean foldCase){
  final String value=sequence.toString();
  for (int i=0; i < value.length(); i++) {
    final char c=value.charAt(i);
    if (MAP_2_NULL.contains(c)) {
      continue;
    }
    if (MAP_2_SPACE.contains(c)) {
      if (canMapToSpace(buffer,trim)) {
        buffer.append(SPACE_CHAR);
      }
      continue;
    }
    if (foldCase) {
      final String mapping=CASE_MAP_TABLE.get(c);
      if (mapping != null) {
        buffer.append(mapping);
        continue;
      }
    }
    buffer.append(c);
  }
}

private static void map ( final StringBuilder buffer , final ByteSequence sequence , final boolean trim , final boolean foldCase ) { final String value = sequence . toString ( ) ; for ( int i = 0 ; i < value . length ( ) ; i ++ ) { final char c = value . charAt ( i ) ; if ( MAP_2_NULL . contains ( c ) ) { continue ; } if ( MAP_2_SPACE . contains ( c ) ) { if ( canMapToSpace ( buffer , trim ) ) { buffer . append ( SPACE_CHAR ) ; } continue ; } if ( foldCase ) { final String mapping = CASE_MAP_TABLE . get ( c ) ; if ( mapping != null ) { buffer . append ( mapping ) ; continue ; } } buffer . append ( c ) ; } }
checks each character and replaces it with its mapping .
