removing unnecessary char[] copying to reduce GC-pressure