update Stream to throw exception on invalid  passed to constructor