MarcosMeli/FileHelpers

FileHelperEngine ReadStream disposes the stream after reading

jwakeen opened this issue · 0 comments

The docs say this doesn't happen. My goal is to be able to read the stream twice. Here's a quick repro:

var blob = new FileStream(@"C:\Tmp\usable.txt", FileMode.Open, FileAccess.Read);
FileHelperEngine engine = new();
TextReader tr = new StreamReader(blob);
ConfirmationRow[] rows = engine.ReadStream(tr);

// Now reset to read the stream again.
blob.Seek(0, SeekOrigin.Begin);

The seek line throws this exception:
System.ObjectDisposedException: 'Cannot access a closed file.'