将1000字节的数据压缩为100字节 [英] compress 1000 bytes of data to 100 bytes

查看:108
本文介绍了将1000字节的数据压缩为100字节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我不想要zipfile,我想将1000字节的数据压缩到100字节,我们如何做到这一点plz帮助我

Hi,
I dont want zipfile I want to compress 1000 bytes of data to 100 bytes how can we do this plz help me

推荐答案

实际上很简单:丢弃所有零位.由于它们什么都不代表,因此您可以毫无问题地丢弃它们.

另外,停止发布具有不同编号的相同问题,然后在回答后将其删除!
It is actually quite simple: throw away all the zero bits. Since they don''t represent anything, you can discard them without any problems.

In addition, stop posting the same question with different numbers, and then deleting it when it is answered!


这是个玩笑吗?使用简单的逻辑.还是不明白吗?

好的,没有人可以帮助您.
是的,在特殊情况下,根据算法的不同,您可以在大约100个字节中打包1000个字节,更好或更糟,但这是当所有数据都由相等的字节组成时!这一切都取决于输入数据.即使您要压缩10%,也没有人可以保证任意数据的结果.

我没有心去尝试解释它.如果对您来说不是很明显的话...
您以前使用过拉链吗?有没有想过知道为什么甚至可以进行无损压缩?这个问题令我震惊.再次告诉我,这是个玩笑吗?

—SA
Is is a joke? Use simple logic. Still not getting it?

OK, nobody can help you.
Yes, in a special case you can pack 1000 in approximately 100 bytes, depending on algorithm, a little better or much worse, but this is when all the data consists of equal bytes! It all depends on input data. Even it you want to compress by 10%, nobody can guarantee you this result for arbitrary data.

I don''t have a heart to try to explain it. If it was not obvious to you in first place…
Did you used zip before? Ever interested to know why lost-less compression is even possible? I was simply shocked by this question. Tell me, again, was that a joke?

—SA


目标压缩大小无法确定或无法固定.
对我来说,霍夫曼压缩算法对我来说效果很好.

要实现该算法,此链接可能有用:
http://www.daniweb.com/code/snippet216267.html [
Target compression size can not be deterministic or can not be fixed.
To me Hoffman compression algorithm works pretty well for me.

To implement the algorithm this link might be useful:
http://www.daniweb.com/code/snippet216267.html[^]

The target compression size depends on the Algorithm and the Input pattern.


这篇关于将1000字节的数据压缩为100字节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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