Added support for writing strings to the buffer.