草庐IT

DeflatorOutputStream

全部标签

java - DeflatorInputStream 和 DeflatorOutputStream 不重构原始数据

我想压缩一些数据,所以我遇到了DeflatorInputStream和DeflatorOutputStream类。但是,以下示例表明在使用这些类时我似乎无法重建我的原始数据。当我切换到ZipInputStream和ZipOutputStream时它确实可以工作,但由于我不需要zip文件本身,我认为通用压缩会更好。我主要想了解为什么这个示例不起作用。//Createsome"random"dataintbytesLength=1024;byte[]bytes=newbyte[bytesLength];for(inti=0;i 最佳答案