Questions tagged [zipinputstream]

A mechanism for reading zip-compressed data from a stream

A ZipInputStream is a mechanism for reading data from a stream, where the data is in a zip-compressed format. A stream is usually comprised of data being read from a local file, or data being transmitted from a remote server over a network protocol such as HTTP or FTP. As the data is read from the stream, the ZipInputStream decompresses it, and returns the uncompressed data to the application.

164 questions
2
votes
1 answer

How to define a method for reading all InputStreams including ZipInputStream?

I asked this once before and my post was deleted for not providing the code that uses the helper class. This time I have created a full test suite which shows the exact problem. I am of the opinion that Java's ZipInputStream breaks the Liskov…
2
votes
2 answers

DotNetZip ZipInputStream issue

I use DotNetZip 1.9.3 library and have faced a problem using BZip2 and AES256 both for 1 entry within 1 archive. ZipOutputStream works fine, but ZipInputStream gets wrong BZip2 header. If I use commom deflate algorithm, everything is fine. I create…
QgecNick
  • 25
  • 1
  • 5
2
votes
1 answer

Insert File To An Existed .APK

I need to add some resource files to an existed .APK file. I wrote a program in Java Se which using ZipInputStream and ZipOutputStream to insert files into assets/myfiles and it works perfectly but when I want to install my new .APK file on my…
2
votes
1 answer

Unzip 64bit zip file with ColdFusion

I was using java.util.zip.ZipFile to unzip large files with ColdFusion. However, I am now getting this error: "invalid CEN header (bad signature)". I found a post that shows that this is related to zip 64 bit format and that I could use…
jessieloo
  • 1,759
  • 17
  • 24
2
votes
2 answers

Java ZipInputStream not reading entire ZipEntry

I'm trying to read an XML file out of a ZIP archive. The relevant code is below: ZipInputStream zis = new ZipInputStream(is); ZipEntry entry = zis.getNextEntry(); while(entry != null) { if(entry.getName().equals("plugin.xml")) { int…
WayneC
  • 2,530
  • 3
  • 31
  • 44
2
votes
2 answers

Randomly accessing a compressed file without using ZipFile (since ZipFile has a major bug)

I know, I know, who would want to compress or uncompressed large files in java. Completely unreasonable. For the moment suspend disbelief and assume I have a good reason for uncompressing a large zip File. Issue 1: ZipFile has a bug (bug # 6280693),…
Ethan Heilman
  • 16,347
  • 11
  • 61
  • 88
2
votes
2 answers

Spring: how to parse uploaded zip file?

I uploaded my zip archive to the server and want to open .txt and .jpg files in it. I successfully get my archive in my Controller and get the name of each file via ZipEntry. Now I want to open it but for this I should get a full path to my file. I…
Winte Winte
  • 753
  • 5
  • 11
  • 24
2
votes
2 answers

ZipInputStream check whether zip file valid before going to extract it

How we check whether zip file corrupted or valid Zip file before going to extract it my code` import java.io.IOException; import java.io.OutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public void unzip() { …
UdayaLakmal
  • 4,035
  • 4
  • 29
  • 40
1
vote
0 answers

Working with ZipInputStream

I'm currently trying to create a download manager (DLManager) that you can submit links to online files and it keeps track of the progress of all the downloads. I works great for normal files but I wanted to add the ability to download and…
1
vote
4 answers

Extracting PDF inside a Zip inside a Zip

i have checked everywhere online and stackoverflow and could not find a match specific to this issue. I am trying to extract a pdf file that is located in a zip file that is inside a zip file (nested zips). Re-calling the method i am using to…
user9604262
1
vote
1 answer

How to unzip files on SFTP in Java?

I am trying to unzip a file on SFTP server. Vector filelist = channelSftp.ls("ML_E_DAM_D_op_files_*.zip"); StringBuilder result = new StringBuilder(); for (int i=0; i
Shatakshi
  • 11
  • 3
1
vote
1 answer

Download zip file and save it in sdcard

I have an application to download zip file and save to sdcard. But I get zipentry=null while reading inputstream, it doesn't enter the while block. Could anyone help me in solving this problem, please? try { // fileInputStream =…
Ammu
  • 29
  • 3
1
vote
1 answer

Reading data from a file inside a zip file in java without extracting the Zip

I need to read a file inside a zip folder without extracting Zip the zip folder then I need to keep all the data in that file in a buffer. public static void getLogBuffers(String path) throws IOException { String zipFileName = path; String…
1
vote
0 answers

Facing java.net.SocketException: Socket closed in Android

I am facing SocketException while unzipping file which is getting from the server. I have used ZipInputStream for extracting file from the Zip folder but I don't know why I'm getting socket exception. As per other answer on SO I have tried to close…
Menu
  • 677
  • 1
  • 12
  • 30
1
vote
2 answers

Java.util.zip.ZipException: invalid entry size (expected 18401 but got 0 bytes) when using putNextEntry() in ZipOutputStream?

I converted a zip file of 5 files into a byte array. I want to output a zip file on my disk from that bytearray. My process was first reading the byte[] into a ByteArrayInputStream then into a ZipInputStream. InputStream plainTextStream = new…