Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide method to export to a base Stream. #55

Closed
shortcord opened this issue Nov 4, 2019 · 3 comments
Closed

Provide method to export to a base Stream. #55

shortcord opened this issue Nov 4, 2019 · 3 comments

Comments

@shortcord
Copy link

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.

@adriancs2
Copy link
Member

adriancs2 commented Nov 5, 2019

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

@shortcord
Copy link
Author

Seems to work fine with my application.
Thanks for the quick response.

@adriancs2
Copy link
Member

Hi, new version of nuget which included the changes discussed in this issue is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants