Use StringBuilder.append(char[]) instead of append(char) in loop