mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
SharpCompress.Archives.ArchiveFactory.IsArchive(Stream, out ArchiveType?) is private #570
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 @AlissaSabre on GitHub (May 10, 2023).
Issue description
We sometimes need to know whether a particular file is an archive of some kind or not an archive. If it is a plain file on the filesystem, SharpCompress provides
SharpCompress.Archives.ArchiveFactory.IsArchive(string, out ArchiveType?)for the purpose. If it is not a file on the filesystem, e.g., it is an in-memory data or a part of a file on the filesystem embedded in a larger file format, theIsArchive(string, out ArchiveType?)doesn't work, unless we first write the data into a single temporary file.The
SharpCompress.Archives.ArchiveFactoryclass has another methodIsArchive(Stream, out ArchiveType?), whch just fits the purpose. However, theIsArchive(Stream, out ArchiveType?)method is private and not available for user programs.I consider it is a bug (or a design flaw.)
Proposed solution
Make
SharpCompress.Archives.ArchiveFactory.IsArchive(Stream, out ArchiveType?)public.