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

Fix error on Next() when skipping files. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajnavarro
Copy link

With this change, we discard remaining bytes for the actual file to
avoid errors on partial reads or skipping files calling Next()
without reading.

Several optimizations are possible, like directly Seek to the next file
without reading the previous one, if the underlying reader supports it.

Signed-off-by: Antonio Navarro Perez [email protected]

With this change, we discard remaining bytes for the actual file to
avoid errors on partial reads or skipping files calling Next()
without reading.

Several optimizations are possible, like directly Seek to the next file
without reading the previous one, if the underlying reader supports it.

Signed-off-by: Antonio Navarro Perez <[email protected]>
@saracen
Copy link
Owner

saracen commented Jun 10, 2020

Thank you for this @ajnavarro!

I don't have much time at the moment, but I'll take a look at this, try it and refamiliarise myself with the codebase at the weekend.

Several optimizations are possible, like directly Seek to the next file
without reading the previous one, if the underlying reader supports it.

I think the reason we're not directly seeking here is because we actually need to read and decompress the previous content in the "folder". Reading and discarding causes the underlying reader to decompress for us.

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

Successfully merging this pull request may close these issues.

2 participants