Streams up to startswith. Implementation different than the proposed one, but simpler as it assumes the potential substream is shorter than the (this) stream