I'm reading a file in line-by-line and I want to be able to restart the read by calling a method Rewind()
.
How can I manipulate my System.IO.StreamReader
and/or its underlying System.IO.FileStream
to start over with reading the file?
I got the clever idea to use FileStream.Seek(long, SeekOffset)
to move around the file, but it has no effect the enclosing System.IO.StreamReader
. I could Close()
and reassign both the stream and the reader referecnes, but I'm hoping there's a better way.