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

ArchiveFactory.IsArchive does not rewind the input stream's position #870

Open
Morilli opened this issue Sep 2, 2024 · 0 comments
Open

Comments

@Morilli
Copy link
Contributor

Morilli commented Sep 2, 2024

Calling ArchiveFactory.IsArchive with 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.FindFactory already has that logic but is only exposed via ArchiveFactory.Open, which in itself seeks the input stream by opening the archive immediately (maybe that should also be changed? not sure).

Morilli referenced this issue in TASEmulators/BizHawk Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants