zstd: option to decompress a single frame/ get total compressed frame length #1019
Unanswered
katexochen
asked this question in
Q&A
Replies: 1 comment 3 replies
-
There is a function that allows you to decode a frame header -and first block header: https://pkg.go.dev/github.com/klauspost/compress/zstd#Header You will need to read the first bytes yourself, but that should be pretty trivial, and you can provide both (maybe using io.MultiReader) if you decide to move on. Note that frame size is optional, so check I can't really tell what seeking you are trying to do, but you would have to do that yourself, since it sounds like a very case-specific thing. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to unpack a bunch of initrds, of which some are compressed zstd, others not (other compression or raw cpio), all concatenated together with some padding in between (format as expected by the kernel).
To unpack this, I either need to
Is this something you'd be interested to support?
(My current implementation iterates over the block headers to calculate the total size of the frame)
Beta Was this translation helpful? Give feedback.
All reactions