用压缩RAR文件 [英] Compress a file with RAR
问题描述
我有我想要压缩它得到一个指定的大小后的文本文件。我已经看过 GZipStream
伟大的工程,但RAR压缩要好得多。搜索结果
我一直在寻找一个库,可以压缩与RAR文件(我真的不关心提取或解压缩),但我无法找到一个还没有。
I have a text file that I want to compress after it gets an specified size. I've already seen GZipStream
which works great, but RAR compression is much better.
I've been looking for a library that can compress a file with RAR (I really don't care about extracting or uncompressing), but I couldn't find one yet.
推荐答案
由于 RAR压缩算法是不是免费的(只有解压算法)你不会找到它库(或必须购买许可证)
As the RAR compression algorithm isn't free (only the decompression algorithm is), you won't find a library for it (or have to purchase a license).
一个很好的替代是的LZMA SDK ,提供7-Zip的所使用的压缩算法。
A good alternative is the LZMA SDK that delivers the compression algorithms used in 7-Zip.
有关的压缩比/速度对比,你可以看看如在最大压缩汇总页面,排名50和52,在最佳实模式和7比较WinRAR的4.01在超模式,邮编9.22。 WinRAR的压缩仅略好(小于1%)。快,7-Zip的解压缩速度更快
For a compression ratio/speed comparison, you can have a look e.g. at the Maximum Compression summary page, ranks 50 and 52, comparing WinRAR 4.01 in "Best Solid" mode and 7-Zip 9.22 in "Ultra" mode. WinRAR compresses only slightly better (<1%) and faster, 7-Zip decompresses faster.
请注意,作为peachykeen提到的,如果你看的效率等级的,而不是大小,WinRAR的在正常模式下比7-Zip的速度要快得多。
Note that, as peachykeen noted, if you look at the efficiency ratings instead of size, WinRAR in normal mode is much faster than 7-Zip.
这篇关于用压缩RAR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!