将zip byte []转换为unzip byte [] [英] convert zip byte[] to unzip byte[]

查看:58
本文介绍了将zip byte []转换为unzip byte []的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有zip文件的 byte [] .我必须解压缩而不创建新文件,并获取该解压缩文件的 byte [] .请帮助我做到这一点

解决方案

您可以使用 ZipInputStream ZipOutputStream (在软件包 java.util.zip <中/code>)以从ZIP文件读取和写入.

如果数据在字节数组中,则可以让它们从 ByteArrayInputStream 中读取或写入指向您的输入和输出字节数组的 ByteArrayOutputStream 中./p>

I have byte[] of zip file. I have to unzip it without creating new file, and get byte[] of that unzip file. Please help me to do that

解决方案

You can use ZipInputStream and ZipOutputStream (in the package java.util.zip) to read and write from ZIP files.

If you have the data in a byte array, you can let these read from a ByteArrayInputStream or write to a ByteArrayOutputStream pointing to your input and output byte arrays.

这篇关于将zip byte []转换为unzip byte []的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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