Android上实现zlib解压缩的方法 Inflater用法
16lz
2021-01-23
由于InflaterOutputStream在Android上不能使用
所以可以考虑采用
Inflater和inflate
import java.util.zip.Inflater;
// Decompress the bytes // 开始解压, Inflater decompresser = new Inflater(); decompresser.setInput(bytes, 0, bytes.length); // 对byte[]进行解压,同时可以要解压的数据包中的某一段数据,就好像从zip中解压出某一个文件一样。 byte[] result = new byte[bytes.length]; int resultLength = decompresser.inflate(result); // 返回的是解压后的的数据包大小, decompresser.end();
更多相关文章
- android greenDao3.2.2存储数据
- Android下获取手机屏幕大小
- android webview字体大小的控制
- Android进度条、自动提示框、下拉框动态数据加载
- Android应用程序组件Content Provider在应用程序之间共享数据的
- android 摄像头图像数据YUV转Bitmap, 再转Base64
- Android开发:设置widget大小为 4x1
- android imageView 自适应大小