Made the Stream class generic