Changed char array to charBuffer to remove an extra copy