Currently in my code I have something in a for loop similar to:
bstr = bstr + x.charAt(i) + x.charAt(i>>4) + x.charAt(i>>8);
Where i is an integer and the loop variable and x is a static final constant string of characters. bstr could be in the order of KBs.
Thanks
A performant way to do this is to use a StringBuilder to concatenate your string:
This technique avoids the problem of storing all the copies of Strings between concatentations across the for loop.
edit:
or does this work for you (without adding chars one at a time):