Quantcast
Channel: sharpcompress Discussions Rss Feed
Viewing all articles
Browse latest Browse all 239

New Post: SaveTo cannot call many time if there an entry added from memorystream.

$
0
0
I found this problem isn't completely solved yet.
If two new files use a same stream, the second file content will be empty after save.
example code:
using (var arc = ZipArchive.Create())
{
    using (var stream = new MemoryStream(Encoding.UTF8.GetBytes("qwert")))
    {
        arc.AddEntry("1.txt", stream, false, stream.Length, null);
        arc.AddEntry("2.txt", stream, false, stream.Length, null);
        arc.SaveTo(@"d:\1.zip", new CompressionInfo());
        arc.SaveTo(@"d:\2.zip", new CompressionInfo());
    }
}

Viewing all articles
Browse latest Browse all 239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>