Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any seekable compression library?

I'm looking for a general compression library that supports random access during decompression. I want to compress wikipedia into a single compressed format and at the same time I want to decompress/extract individual articles from it.

Of course, I can compress each articles individually, but this won't give much compression ratio. I've heard LZO compressed file consists of many chunks which can be decompressed separately, but I haven't found out API+documentation for that. I can also use the Z_FULL_FLUSH mode in zlib, but is there any other better alternative?

like image 841
Wu Yongzheng Avatar asked Jan 12 '10 03:01

Wu Yongzheng


People also ask

What are some examples of compressed files?

Examples of compressed file extensions are . RAR, . ZIP and . TAR.

Which format has best compression?

At maximum compression level, ZIPX is the fastest format, followed by RAR, ARC, and 7Z, ZPAQ being the slowest. Using moderate compression settings, RAR and ARC emerge as the fastest formats.

What is the most common file compression?

Three of the most popular file compression formats are Zip, RAR, and 7z. They gained popularity early on due to their high compression rates, which helped them stand out when there were many other compression formats available.

What is compression in Java?

Object compression is done at the sender side and uncompressed them at the other end i.e receiver side. By this, we can improve the performance and can send and receive the objects in heavy quantity between two ends.


1 Answers

xz-format files support an index, though by default the index is not useful. My compressor, pixz, creates files that do contain a useful index. You can use the functions in the liblzma library to find which block of xz data corresponds to which location in the uncompressed data.

like image 169
vasi Avatar answered Sep 27 '22 21:09

vasi