rather than use str += String.valueOf( c) try using a StringBuffer and use the append.

something like:
sb.append(Strin g.valueOf(c))