-
Notifications
You must be signed in to change notification settings - Fork 508
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
IsGzipped consumes the io.Reader it's reading #112
Comments
I think we just need something that implements Peek, like bufio.Reader: Or something that implements ReadAt, like os.File: For most things we're already passing around a File, but I think using a buffered Reader might be easier to bolt onto existing code. |
This issue is stale because it has been open for 90 days with no |
I'm pretty sure this is the reason I can't do this:
|
IsGzipped
determines whether the given reader represents gzipped data by consuming the first two bytes of the reader and looking for a magic header. This consumes the data, so subsequentIsGzipped
checks will not identify the contents as gzipped.This isn't a problem in practice while
Reader
s are only checked once while reading tarballs, but this could become a problem in the future, or if a client decides to callIsGzipped
themselves on aReader
before passing it totarball.Image
(naively wrapped in anOpener
).The text was updated successfully, but these errors were encountered: