Using buffers to write strings