when I create a zip file to a seekable stream that contain some content,the zip content overrides the original content #187

Closed
opened 2026-01-29 22:07:59 +00:00 by claunia · 5 comments
Owner

Originally created by @yinyue200 on GitHub (May 30, 2017).

English is not my native language; please excuse typing errors.
Thanks

Originally created by @yinyue200 on GitHub (May 30, 2017). English is not my native language; please excuse typing errors. Thanks
claunia added the bug label 2026-01-29 22:07:59 +00:00
Author
Owner

@adamhathcock commented on GitHub (May 30, 2017):

I don't think I understand what you mean on this one. What do you mean "orderless stream?"

@adamhathcock commented on GitHub (May 30, 2017): I don't think I understand what you mean on this one. What do you mean "orderless stream?"
Author
Owner

@yinyue200 commented on GitHub (May 30, 2017):

@adamhathcock it means zip content overrides the original content

@yinyue200 commented on GitHub (May 30, 2017): @adamhathcock it means zip content overrides the original content
Author
Owner

@adamhathcock commented on GitHub (May 30, 2017):

That sounds like a desired behavior. You might need to give me a code sample.

@adamhathcock commented on GitHub (May 30, 2017): That sounds like a desired behavior. You might need to give me a code sample.
Author
Owner

@yinyue200 commented on GitHub (May 31, 2017):

using (var file = System.IO.File.Create("D:\\a.zip")) { var bt=System.Text.Encoding.UTF8.GetBytes("https://github.com/adamhathcock/sharpcompress/issues/244"); file.Write(bt,0,bt.Length); using (var zw = new SharpCompress.Writers.Zip.ZipWriter(file, new SharpCompress.Writers.Zip.ZipWriterOptions(SharpCompress.Common.CompressionType.Deflate))) { zw.WriteToStream("a",new SharpCompress.Writers.Zip.ZipWriterEntryOptions()).Dispose(); } }
And the file will not start with the URL.
@adamhathcock

@yinyue200 commented on GitHub (May 31, 2017): `using (var file = System.IO.File.Create("D:\\a.zip")) { var bt=System.Text.Encoding.UTF8.GetBytes("https://github.com/adamhathcock/sharpcompress/issues/244"); file.Write(bt,0,bt.Length); using (var zw = new SharpCompress.Writers.Zip.ZipWriter(file, new SharpCompress.Writers.Zip.ZipWriterOptions(SharpCompress.Common.CompressionType.Deflate))) { zw.WriteToStream("a",new SharpCompress.Writers.Zip.ZipWriterEntryOptions()).Dispose(); } }` And the file will not start with the URL. @adamhathcock
Author
Owner

@adamhathcock commented on GitHub (May 31, 2017):

Thanks for finding this. It was a bug introduced with the Zip64 writing support.

@adamhathcock commented on GitHub (May 31, 2017): Thanks for finding this. It was a bug introduced with the Zip64 writing support.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#187