Avoid passing temporary arrays to write_data.