Questions tagged [zipoutputstream]

ZipOutputStream is used to write ZipEntrys to the underlying stream. Output from ZipOutputStream can be read using ZipFile or ZipInputStream.

A ZipOutputStream is a mechanism for writing data to a stream in a zip-compressed format. A stream is usually comprised of data to write to a local file, or data being transmitted to a remote server over a network protocol such as HTTP or FTP. As the data is given to the ZipOutputStream, it is compressed, and then transmitted to the stream.

170 questions
5
votes
2 answers

Android append files to a zip file without having to re-write the entire zip file?

How can I append files to an existing zip file? I already have the code that can create a zip file and it works great except for one big problem. The way it works now, the user takes a bunch of pictures, and at the end, all the pictures get added…
Jared
  • 2,999
  • 1
  • 28
  • 39
5
votes
3 answers

Zip subfolders using ZipOutputStream

ZipOutputStream only zips files in a folder. I want to zip subfolders also. How can I achieve this?
BreakHead
  • 10,480
  • 36
  • 112
  • 165
5
votes
1 answer

Compressing(zip) List of files with ZipOutPutStream Java

I`m trying to compress a list of Xml converted on Strings, save them in only one zip file and returning as a body of a POST on restful. But everytime I save the file I get the error "The archive is either in unknown format or damaged". protected…
5
votes
0 answers

How to create zip files from ZipOutputStream in hadoop MapReduce

My MapReduce has to read records from HBase and need to write into zip files. Our client has asked specifically that the reducer output files should be .zip files only. For this I have written the ZipFileOutputFormat wrapper to compress the records…
Sudarshan kumar
  • 1,503
  • 4
  • 36
  • 83
5
votes
2 answers

Using a servlet, how do you download multiple files from a database and zip them for client download

I have a jsp/servlet web app in which the client can choose a "course" and an "assignment" via dropdown boxes, and then click a button to download all the files in the database that are listed under that course/assignment combination. The servlet…
Lani1234
  • 522
  • 5
  • 12
  • 21
5
votes
3 answers

Java Developed Zip File Not opening in Windows 7 default

I have created the Zip file using ZipOutputStream. The zip file is created sucessfully and able to open using WinRar and Winzip file. And the files are showing inside the Zip File. But same file, I am unable to open in Windows 7 default Zip…
4
votes
5 answers

Error opening zip file created using java

I created a small application to read some files from the disk and zip it using java.util.zip.ZipOutputStream. It is successfully creating the zip file. But in windows when i try to open it / extract it am getting the error message like "Windows has…
Anoop
  • 1,439
  • 5
  • 20
  • 37
4
votes
0 answers

Writing to ZipOutputStream by multiple thread

Problem: I need to download lot of files(size of file can be upto 2GB) and send those as zip to the client requesting for resource. I was looking to parallelize that operation. Currently the library I've to use takes OutputStream (in my case it's…
User5817351
  • 989
  • 2
  • 16
  • 36
4
votes
1 answer

zip creation error in java

I am using ZipOutputStream,FileOutputStream and FileInputStream. First I created a folder with one file. It successfully created. Then I tried to create zip files. Dynamically, it creates file first time correctly but at second time , third time it…
Chaitanya Joshi
  • 304
  • 1
  • 4
  • 22
4
votes
1 answer

Generated ZIP file is corrupt / invalid

I'm trying to create a simple ZIP file in Java, but once generated, I can't open it with either Windows Explorer or 7-zip, as they say the file is invalid / unrecognized / corrupted. However, I'm following all the tutorials I've seen and using a…
Lazlo
  • 8,518
  • 14
  • 77
  • 116
3
votes
1 answer

Java - Zip output stream dynamic buffer size

I'm working on application that takes files from one zip and put them in the other, its fine with files but if there is a dir in the source zip it fail with the following exception: Exception in thread "main" java.util.zip.ZipException: invalid…
Liam Haworth
  • 848
  • 1
  • 9
  • 27
3
votes
2 answers

Java ZipOutputStream only deflate certain files / deflate filter

This is a two part question, really. Preface: I use WinRAR to compress files. It gives you the option of only compressing certain files. I can filter by file extension so that, say, JPEG files are not compressed, while other files are. Can this be…
Scott
  • 365
  • 3
  • 8
3
votes
2 answers

Return Zip File from ZipOutputStream in Java

I have a function which creates a Zip file from a list of files. Is it possible to return the Zip file without it being saved on the disk? I need the file as I have to use the zip file as a parameter for another function. I am not sure of the…
Vini
  • 1,978
  • 8
  • 40
  • 82
3
votes
0 answers

how to optimize ZipOutputStream to use less ram memory

I am using this code to download zip file containing jasper reports. How can I use less memory on my Servlet? Can I use disk space instead of memory? or is there any other way so that my server will not give me an error saying "out of memory" if…
Khurram
  • 45
  • 4
3
votes
0 answers

Zip folder is corrupted after editing content

I am trying to copy a zipped bytes array to another one using ZipOutputStream/ZipIntputStream, but it seems that the result array is not equal the original one, why is that wrong? public static void main(String[] args) throws IOException { File…
1
2
3
11 12