change copy_buffer interface to be consistent with read_buffer etc