Use an iostreams stream_buffer here