stream: change common write interface