rename method toBinaryStream to toInputStream