I would like to have similar functionality for a TextReader that a Stream has. Specifically the ability to set position in the stream. Is there any way to change a TextReader into a stream?
I would like to accept a TextReader but access it like a Stream.
You can’t do this in the general case. Not all
TextReaderinstances are based on streams.Also, a
TextReaderis based on lines of text, where the line terminators may not be the sort that you can back up over.