Skip to content

Support resumable decompression #41

@phord

Description

@phord

I want to be able to decode all or part of a file and then rewind (Seek) to some earlier point in the file and re-decode it. This would enable the file to be read as random-access, once the initial read was done.

Doing this requires being able to save the state of some earlier decode point. I think I can clone the FrameDecoder (once I make it and its children Cloneable) and use this and the source file position to restore my read to some earlier point.

Supporting this mode will make it possible to support something almost like zstd-seekable without first having to compress the file in a multi-frame format.

libz has support for this; it's seldom used but it comes in handy when needed.

I can work on this some myself but I could use some guidance. For example, I suspect I don't need to clone the entire FrameDecoder struct to make this work; I don't think I need all the buffers it holds. I may only need the relevant context information (dictionaries, bit positions, etc.) and some feeder data.

I wouldn't mind only saving state at the end of a block, but I'm not sure if that's advantageous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions