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, the IsArchive(string, out ArchiveType?) doesn't work, unless we first write the data into a single temporary file.
The SharpCompress.Archives.ArchiveFactory class has another method IsArchive(Stream, out ArchiveType?), whch just fits the purpose. However, the IsArchive(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.
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.ArchiveFactory
class 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.