Skip to content

FileHelperEngine ReadStream disposes the stream after reading #435

@jwakeen

Description

@jwakeen

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.'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions