#97 introduce a stream factory for scanning inputstreams