mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
ArchiveFactory.IsArchive does not rewind the input stream's position #658
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Morilli on GitHub (Sep 2, 2024).
Calling
ArchiveFactory.IsArchivewith a stream as input parameter will potentially seek the given stream. That is necessary of course, but after returning, the stream should be seeked back to its original position.After all, you might want to check whether a given input is a valid archive that can be handled by SharpCompress before continuing to construct an archive from that stream (or do other things with that stream).
It looks like
ArchiveFactory.FindFactoryalready has that logic but is only exposed viaArchiveFactory.Open, which in itself seeks the input stream by opening the archive immediately (maybe that should also be changed? not sure).