make sure stream classes throw correct exceptions