什么是最好的压缩算法,允许在文件中的随机读/写? [英] What is the best compression algorithm that allows random reads/writes in a file?

查看:629
本文介绍了什么是最好的压缩算法,允许在文件中的随机读/写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是最好的压缩算法,允许在一个文件中的随机读/写?



我知道任何自适应压缩算法都是没有问题的。 p>

我知道huffman编码是不可能的。



有没有人有更好的压缩算法随机读/写?



我想你可以使用任何压缩算法,如果你写在块中,但理想情况下,我不想要解压整个块时间。但如果你有一个简单的方法来做这个,如何知道块边界的建议,请让我知道。如果这是您的解决方案的一部分,也请让我知道当你想要读取的数据是跨块边界时,你做什么?



在你的答案的上下文请假设有问题的文件是100GB,有时我想读取前10个字节,有时我想读取最后19个字节,有时我想在中间读取17个字节。 。

解决方案

我惊ned地发现这种事情是不可能的回应数。



这些人从来没有听说过自1993年微软在Stac电子公司被压缩文件系统技术被起诉以来一直存在的压缩文件系统,



我听说 LZS LZJB 是用于实施压缩文件系统的人们常用的算法,这些算法必然需要随机访问读取和随机访问写入。



也许最简单和最好的办法是打开文件系统压缩,让操作系统处理细节。
但是如果你坚持手动处理它,也许你可以通过阅读 NTFS透明文件压缩



还可以查看:
StackOverflow:压缩格式对存档内的随机访问有很好的支持


What is the best compression algorithm that allows random reads/writes in a file?

I know that any adaptive compression algorithms would be out of the question.

And I know huffman encoding would be out of the question.

Does anyone have a better compression algorithm that would allow random reads/writes?

I think you could use any compression algorithm if you write it in blocks, but ideally I would not like to have to decompress a whole block at a time. But if you have suggestions on an easy way to do this and how to know the block boundaries, please let me know. If this is part of your solution, please also let me know what you do when the data you want to read is across a block boundary?

In the context of your answers please assume the file in question is 100GB, and sometimes I'll want to read the first 10 bytes, and sometimes I'll want to read the last 19 bytes, and sometimes I'll want to read 17 bytes in the middle. .

解决方案

I am stunned at the number of responses that imply that such a thing is impossible.

Have these people never heard of "compressed file systems", which have been around since before Microsoft was sued in 1993 by Stac Electronics over compressed file system technology?

I hear that LZS and LZJB are popular algorithms for people implementing compressed file systems, which necessarily require both random-access reads and random-access writes.

Perhaps the simplest and best thing to do is to turn on file system compression for that file, and let the OS deal with the details. But if you insist on handling it manually, perhaps you can pick up some tips by reading about NTFS transparent file compression.

Also check out: "StackOverflow: Compression formats with good support for random access within archives?"

这篇关于什么是最好的压缩算法,允许在文件中的随机读/写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆