Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

convert zip byte[] to unzip byte[]

Tags:

java

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

like image 933
vishal Avatar asked Feb 09 '12 10:02

vishal


1 Answers

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.

like image 119
Jesper Avatar answered Oct 16 '22 15:10

Jesper