Work with a buffer rather than string concat.