Skip to content

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

Open
ajnavarro wants to merge 1 commit into
saracen:masterfrom
ajnavarro:fix-skip-files
Open

Fix error on Next() when skipping files.#5
ajnavarro wants to merge 1 commit into
saracen:masterfrom
ajnavarro:fix-skip-files

Conversation

@ajnavarro

Copy link
Copy Markdown

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 antnavper@gmail.com

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 <antnavper@gmail.com>
@saracen

saracen commented Jun 10, 2020

Copy link
Copy Markdown
Owner

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