Question: How to get XZ uncompressed size
See original GitHub issueHello, as far as I know XZ format has index section which contains archive metadata (most notably - uncompressed size).
I’ve skimmed through XZ implementation in this package and looks like sharpcompress can read XZ index, but it’s impossible to get XZBlock information without reading and decompressing whole archive contents.
How can I get XZ index information using this library without extracting archive contents?
It would nice to have to populate uncompressed stream size in Length
property.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Get final uncompressed size · Issue #15 · addaleax/lzma- ...
By taking a closer look, this is calculated by running the lzma_index_uncompressed_size() function on a lzma_index populated by a quite big ...
Read more >How can I get the uncompressed size of gzip file without ...
Unfortunately, the only way to know is to extract it and count the bytes. gzip files do not properly report uncompressed data >4GB...
Read more >Fastest way of working out uncompressed size of large ...
I believe the fastest way is to modify gzip so that testing in verbose mode outputs the number of bytes decompressed; on my...
Read more >xz(1) - Linux man page
lzma files created by xz will use end of payload marker and have uncompressed size marked as unknown in the .lzma header. This...
Read more >Linux xz, unxz, xzcat, lzma, unlzma, lzcat command
The . xz headers store the dictionary size either as 2^n or 2^n + 2^(n-1), so these sizes are somewhat preferred for compression....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Zip has the same issue with streamed files where you don’t know the size before compression.
We should be able to implement this size on XZ when using Archive strategy but not Reader strategy
@adamhathcock here is a simple snippet to calculate uncompressed size of XZ contents. Hope it helps.
Works only with seekable streams. For non-seakable streams, a whole file should be read before.