ideally you would reserve space in the target buffer before appending the data so avoid reallocating the buffer.  This could be called on very large strings.