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
1
vote
1 answer

.war file created using ZipOutputStream fails to deploy

I am reading a .war file and after reading it into a ZipInputStream , i edit the web.xml and add weblogic.xml - and then transfer all this into ZipOutputStream , which i write as the final output.war file. The problem that i am facing is , the…
Tom
  • 135
  • 1
  • 5
  • 14
1
vote
2 answers

Create zip from paperclip attachments and download

Trying to create a zip file containing many pictures, my code is as follows: compressed_filestream = Zip::OutputStream.write_buffer do |zos| @pictures.each do |p| image_url = p.picturefile.url(:original) …
hso
  • 345
  • 3
  • 19
1
vote
1 answer

closeEntry() of Class ZipOutputStream

I'm writing a code with Java7 and I use the try-with-resources feature. When I create an instance of ZipOutputStream. By doing that I no longer have to close the stream in the finally block. The try-with-resources managed that (by the JVM of…
1
vote
1 answer

ZipOutputStream : BufferedOutputStream vs PrintStream

I want to use ZipOutputStream for writing big chunks of bytes what is preferred ? FileOutputStream fos = new FileOutputStream(fileName); ... ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(fos)); Or ZipOutputStream zos = new…
Saar peer
  • 817
  • 6
  • 21
1
vote
2 answers

Create one Zip file using a set of pdf files

My app is a tender document system where each tender number has one or more pdf files attached. application is done in java ee using struts and mysql. in a database table the paths of each related pdf file for a tender number is stores. I want to…
Bhugy
  • 711
  • 2
  • 8
  • 23
1
vote
1 answer

Java Create 100MB zipped csv file performance issue

I need to create 100mb zipped file within 5 seconds which contains a CSV file using java. I have created test.zip which contains the CSV file but it is taking too much time (~30 seconds) to generate the zip file. Here is the code that I've written…
1
vote
1 answer

Writing zipped byte[] into file

I am trying to write a zipfile to a byte[] in memory, and then write that out to disk. The resulting zipfile is corrupt. This works: try (FileOutputStream fos = new FileOutputStream(Files.createTempFile("works", ".zip").toFile()); …
Yosef Weiner
  • 5,432
  • 1
  • 24
  • 37
1
vote
2 answers

how to replacing some files within a certain directory inside a jar file?

I'm having the problem of replacing or updating some files within a certain directory inside a jar file. I've read a few post already. The code (the JarUpdater Class) given at this link Updating .JAR's contents from code is being very helpful for…
mk7
  • 150
  • 1
  • 9
1
vote
2 answers

ZipOutputStream - closeEntry() first or close() first

Following is part of the some code. I need to close out resources in finally clause. Do I need to call closeEntry() first or close()? I am getting some error messages. Error closing the zipoutjava.io.IOException: Stream closed at …
user3123690
  • 1,053
  • 5
  • 17
  • 27
1
vote
1 answer

creating zip file to byte array

I'm trying to read create a zip file out of a list of file paths. I wanted to have the zip file as a byte array so that i can return it as a ResponseEntity object back to the web page. the problem is when i tried FileOutputStream it works. I tried…
vincent
  • 243
  • 1
  • 7
  • 17
1
vote
3 answers

Programmatically generating zip creates invalid zip[android]

I have a folder with 3 picture inside of them which I wish to zip and email. I have a method that does this which I've used with previous problems and it works fine. However this time it keeps generating an invalid zip and when I open the zip it…
john
  • 3,949
  • 7
  • 34
  • 56
1
vote
1 answer

How to create zip file with two outputStreams (working with JSF)

I've got two outputstreams (filled with data by jasper reports to generate one excel and one csv). The filling of the outputstreams works just fine, but now I have to pack both "streams / files" in to a zip to be downloaded. How could I do this?…
GregD
  • 1,884
  • 2
  • 28
  • 55
1
vote
1 answer

Programmatically generated zip invalid on pc but not on android

SOLVED: ok so I am basically stupid. I couldn't open the file because I forgot to install winrar or 7zip since this pc is newly formatted... Everything works fine. Sorry to waste anyone's time. In my app I programmatically generate a .zip file from…
john
  • 3,949
  • 7
  • 34
  • 56
1
vote
1 answer

ZipOutPutStream, ZipEntry return null when I try to dezip

I have a function to compress a file and another to decompress it. When I try to decompress an archive I've generated with my own function, there is a null pointer exception because it doesn't found the ZipEntry... When I try to decompress an…
Skartt
  • 551
  • 2
  • 7
  • 19
1
vote
2 answers

Incomplete Java fileoutputstream with textfiles

I am coding a little tool to encrypt and decrypt files. The encrypted files will be added to a zip-archive. The following code is working so far. I can encrypt any files but textfiles. If I choose a textfile it is written incomplete. If there is the…
Seppel
  • 27
  • 5