Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharpCompress.Archives.ArchiveFactory.IsArchive(Stream, out ArchiveType?) is private #739

Closed
AlissaSabre opened this issue May 10, 2023 · 0 comments

Comments

@AlissaSabre
Copy link
Contributor

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, 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.

adamhathcock added a commit that referenced this issue May 10, 2023
Make ArchiveFactory.IsArchive(Stream, ...) public. Fix #739
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant