buffer write