MarcosMeli / FileHelpers

The FileHelpers are a free and easy to use .NET library to read/write data from fixed length or delimited records in files, strings or streams
https://www.filehelpers.net
MIT License
1.13k stars 349 forks source link

FileHelperEngine ReadStream closes the stream, although the documentation says otherwise #416

Closed ueli-werner closed 2 years ago

ueli-werner commented 2 years ago

Doc: "This method only uses the stream and does not close them after using it, you must do it."

In version 2.0.0 this was the behavior. Now in version 3.5.1 the stream is closed. Unclear if the behavior change was intentional or not. Either update the documentation or change the behavior.

If it was intentional it is a breaking change.

FileHelpers.dll!FileHelpers.ForwardReader.Close() Line 153 C# FileHelpers.dll!FileHelpers.ForwardReader.System.IDisposable.Dispose() Line 162 C# FileHelpers.dll!FileHelpers.FileHelperEngine.ReadStreamAsList(System.IO.TextReader reader = {System.IO.StreamReader}, int maxRecords = 2147483647, System.Data.DataTable dt = null) Line 304 C# FileHelpers.dll!FileHelpers.FileHelperEngine.ReadStream(System.IO.TextReader reader = {System.IO.StreamReader}, int maxRecords = 2147483647) Line 131 C# FileHelpers.dll!FileHelpers.FileHelperEngine.ReadStream(System.IO.TextReader reader = {System.IO.StreamReader}) Line 123 C#