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

Derive Clone for InflateState to allow random-access reads #157

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

phord
Copy link
Contributor

@phord phord commented Oct 2, 2024

I am implementing Seek for a wrapper that reads deflated files. To do this, I will inflate the file once and save the dictionary and inflate state at several points in the file. Later, when I want to seek to some random place in the file, I will use the cloned state+dict to position to a known file position and then inflate until I reach the data I need.

To support this, I need to be able to Clone the InflateState and its parts (the current dictionary). Derive Clone for InflateState, HuffmanTable and DecompressorOxide.

Add tests: partial stream resumption; partial resume with a cloned state variable.

I am implementing Seek for a wrapper that reads deflated files.  To do this, I will
inflate the file once and save the dictionary and inflate state at several points in
the file.  Later, when I want to seek to some random place in the file, I will use the
cloned state+dict to position to a known file position and then inflate until I reach
the data I need.

To support this, I need to be able to Clone the InflateState and its parts (the current
dictionary).  Derive Clone for InflateState, HuffmanTable and DecompressorOxide.
@oyvindln oyvindln merged commit 0a33eff into Frommi:master Oct 4, 2024
7 of 8 checks passed
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