Provide method to export to a base Stream.
shortcord opened this issue · 3 comments
For example:
public void ExportToStream(Stream sm)
{
if (sm.CanSeek)
sm.Seek(0, SeekOrigin.Begin);
textWriter = new StreamWriter(sm, textEncoding);
ExportStart();
}
Recently I had to export a Database that was >4GB and due to MemoryStream being backed by an Array, I was limited to 3.5Gb per stream, I couldn't use ExportToFile due to how my app saved files.
Instead, I called Path.GetTempFileName() to create a temporary file stream and then fed that to the new ExportToStream method.
Another option would have been to not have ExportToMemoryStream limited to just MemoryStream, check if it can seek and throw if the Stream is null.
This should be no problem to be implemented. I have added the code into the source code. Before the Nuget package is released publicly, you may try out below attached file of the patched (modified) DLL (and source file) and test it in your environment, and see if there is any feedback from your side after testing.
Below is built for .NET Standard 2.0, in case of your project does not support .NET Standard, you may use the source file directly in your project.
MySqlBackup_Issue_55_debug_v1.zip
Seems to work fine with my application.
Thanks for the quick response.
Hi, new version of nuget which included the changes discussed in this issue is released.