A
Anders Olsson
I need to create a StreamReader which starts from the position of an
existing StreamReader. This way, the second StreamReader can read lines
"ahead" in an own loop, and then I can go back to the outer loop and the
first StreamReader is still where I left it.
I have been trying to do this using this code:
StreamReader sr2 = sr1 //Where sr1 is the existing StreamReader
This seems to work just fine, so I guess this is a supported way of doing
it. The only problem is that when sr2 reaches EOF, sr1 also goes EOF
(EndOfStream). Why is this?
Should I be doing this another way perhaps?
Thanx! /Anders
existing StreamReader. This way, the second StreamReader can read lines
"ahead" in an own loop, and then I can go back to the outer loop and the
first StreamReader is still where I left it.
I have been trying to do this using this code:
StreamReader sr2 = sr1 //Where sr1 is the existing StreamReader
This seems to work just fine, so I guess this is a supported way of doing
it. The only problem is that when sr2 reaches EOF, sr1 also goes EOF
(EndOfStream). Why is this?
Should I be doing this another way perhaps?
Thanx! /Anders