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
0
votes
1 answer

Android Unzipping file from ftp throw "data error" and "CRC mismatch" error

(First of all I'm new here and my english is not very good, so I want to apologize for my bad writting skills) I'm working on a Android proyect which reads from a public FTP server some .zip files and get the content from them. I'm connecting to…
japo
  • 13
  • 7
0
votes
1 answer

Using InputStream and ZipInputStream in java

In Java, I am accepting an input stream from a webpage which happens to be a zip file. I would like to unzip the file before saving it to the disk. However, my zipInputStream.getNextEntry throws the following error: "java.util.zip.ZipException:…
austinthemassive
  • 5,907
  • 6
  • 21
  • 25
0
votes
1 answer

Rewinding ZipInputStream - Android

I am trying to read a Zip archive with a ZipInputStream. I cycle through all the entries without any problem like so: try { while((ze = zis.getNextEntry()) != null) { Log.v(this.toString(), "Name = " + name); …
Sriram
  • 10,298
  • 21
  • 83
  • 136
0
votes
2 answers

Java (ZipEntry) - if the file name contains czech characters (čžř etc) it fails while reading next entry

I have a problem when I try to unzip file contains files with special characters. Lets say I have a zip file gallery.zip with image files. gallery.zip - file01.jpg - dařbuján.jpg My method starts: public List
Jan Bouchner
  • 875
  • 1
  • 14
  • 38
0
votes
0 answers

Is there any way to append a file to a zip with a different name in Java?

I am wondering if there is a way, instead of just adding a file to a zip, to rename a file when adding it. I know of the write method: (while ((len = zin.read(buf)) > 0) { out.write(buf, 0, len); } I have…
Ajay
  • 437
  • 7
  • 22
0
votes
0 answers

'null' while completely iterating over ZipEntry (From ZipInputStream)

I'm using ZipInputStream in following way (Code): public InputStream getArtifactInputStream(InputStream contentInputStream) throws ArtifactProviderException { ZipInputStream zipInputStream = new ZipInputStream(contentInputStream); …
0
votes
1 answer

Sharpzlib read an ZipInputStream with resume

What I'm trying to achive is to enable an application to extract a large remote file (from ftp or http), without fully downloading it and with the possibility to resume the extraction in case of network failure. Following this example…
Francesco
  • 4,794
  • 1
  • 19
  • 27
0
votes
2 answers

Writing byte array to GAE Blobstore

I'm able to read the bytes and print it out on System console. However since GAE does not support file creation, I search through StackOverflow and found out that I can write into GAE blobstore. But I'm not sure how to go about doing it as I'm new…
chuntato
  • 128
  • 1
  • 7
-1
votes
1 answer

Java program ignoring all the files inside the zip file

I have program when I give a zip folder path via console. It will go through each item inside that folder (every child item, children of child, etc..). But if it encounters a zip folder it will ignore everything inside the zip folder, I need to read…
-1
votes
1 answer

How to get a size of a image file which is inside a folder which is inside a zip file

I have the following snippet and this is used to check if the given zip entry is a directory or not which works fine.There is an additional requirement given where I need to check the size of each image (its size should not be > 10 MB) inside the…
Karthik
  • 371
  • 3
  • 7
  • 30
-1
votes
1 answer

Getting java.io.IOException: Stream closed error without explicitly closing it

My zipInputStream is getting closed after writing the first file itself even though I am not closing any of the streams. ZipInputStream zipInputStream = new ZipInputStream(inputStream); ZipEntry zipEntry = zipInputStream.getNextEntry(); while…
Sapna Dhalor
  • 86
  • 1
  • 8
-1
votes
1 answer

How does InputStream.read(byte[]) work?

I'm trying to unzip a zip folder, I have problem understand how the ZipInputStream.read(byte[]) work. This code work just fine but I don't know if my file is bigger than the buffer I set how I'll operate. byte[] buffer = new byte[1024]; zipIs = new…
-2
votes
1 answer

scanner can't read data from zipinputstream

I have a piece of code for reading CSV file from a zipInputStream. I am trying to read all entries of this zipInputStream, so if there is txt, pdf. I don't need any of them, the zip file supposed to be impressed by one and only one CSV file, if not,…
-2
votes
1 answer

Difficulty with Unencrypting: Error is BadPaddingException: Given final block not properly padded

Trying to Unencrypt zipped files. Some work and others don't. Those that don't work give the error when trying to close the ZipInputStream. This was working fine when creating files on the user's computer, but I want to avoid this security risk. …
KSK
  • 149
  • 3
  • 15
1 2 3
10
11