Replace deprecated Z(Input|Output)Stream

Thanks to Волков Вячеслав (Vyacheslav Volkov) for the hint.