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
0
votes
2 answers

How to put two jasperReports in one zip file to download?

public String generateReport() { try { final FacesContext facesContext = FacesContext.getCurrentInstance(); final HttpServletResponse response = (HttpServletResponse)…
StudioWorks
  • 483
  • 1
  • 6
  • 25
0
votes
2 answers

C# OutOfMemoryException creating ZipOutputStream using SharpZipLib

I keep getting a very annoying OutOfMemory exception on the following code. I'm zipping a lot of small files (PDF, each being 1.5mb approx). At first I was getting the exception afer 25 files zipped, which doesn't seem like a massing archive.…
Etienne
  • 1,058
  • 11
  • 22
0
votes
2 answers

Empty Folders are not adding to zip file android

I am doing an Android project. I need to zip a complete folder structure of SD card. code is able to zip the folder if any files exists inside the folder, else skips that folder. My Folder structure is like:…
user2085965
  • 393
  • 2
  • 13
  • 33
0
votes
2 answers

ZipOutputStream - zipping files with wrong content

i can zipping files, but with wrong content ... for example - content in…
PeJak
  • 5
  • 1
  • 4
0
votes
1 answer

What is default size of ZipEntry

If I create a ZipEntry without specifying it's size, what is default size? Do I need to specify it's size? When do we set the size? I see that ZipEntry has a setSize(long size) method. ZipEntry entry = new ZipEntry(filename);
user3123690
  • 1,053
  • 5
  • 17
  • 27
0
votes
1 answer

java.util.zip.ZipException when adding a ZipEntry to a ZipOutputStream without a ZipInputStream

I am attempting to add a ZipEntry to a ZipOutputStream but am running into problems when trying to write the bytes. I got the ZipEntry from a HashMap which maps file names to their ZipEntries. I chose this method because I am dealing with a large…
vohab
  • 43
  • 7
0
votes
0 answers

Java ZipOutputStream extra file created when builiding Zip

I'm creating EPUB files from an application, using ZipOutputStream. When I look at the resulting zip file with Winzip, it seems to be OK, except that in addition to the files and folders I expect, there is an additional folder which should not be…
casgage
  • 529
  • 1
  • 7
  • 18
0
votes
1 answer

Convert files to xml, then add them to zip

I use a method to create xml files using XMLOutputter, FileWriter, and BufferedWriter. It works fine but the xml files can be rather larger (more than 10 megs) and I work with a lot of them. I am trying to find a way to write the files directly to…
jpl
  • 105
  • 2
  • 11
0
votes
2 answers

ZipOutputStream complains of FileNotFoundException

new_file_name is something like 2013-03-15-08:59:10_65.zip fileZip = new ZipOutputStream(new FileOutputStream(new File(new_file_name))); byte[] buffer = new byte[1024]; try{ for(String fileName:fileList) { …
roymustang86
  • 8,054
  • 22
  • 70
  • 101
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

ZipOutputStream FTPClient

FTPClient ftpClient; ZipOutputStream zipOut = null; zipOut = new ZipOutputStream(ftpClient.storeFileStream("a.zip")); String str; byte []conarr=str.getBytes(); zipOut.putNextEntry(new ZipEntry("1.txt"));…
0
votes
1 answer

Replace file in ZipOutputStream

I would like to create zip file. File will contains exported Preferences and Serializable object. But when i try replace Object in zip archive saved Preferences disapear. How solve this problem? import java.io.BufferedOutputStream; import…
user902691
  • 1,149
  • 4
  • 20
  • 46
0
votes
1 answer

Premature end of file. exception trying to parse xml from Zipinputstream

I am trying to extract an xml file & other contents from a ZipInputStream and create my objects from xml parsing the zipinputstream. However I am getting Premature end of file exception - for the following code or Stream Closed - when I dont have…
-1
votes
1 answer

How do i add files into a zip for download?

My files does not have a path because it is stored in the database. I retrieve it from blob to bytes. Whenever i download the .zip file, the file is invalid and empty even though the size of the .zip file is not 0kb. @RequestMapping(value =…
Luffyyy
  • 17
  • 3
-1
votes
1 answer

Assigning zip filename in Java and convert it as ByteArrayOutputStream

I am currently trying to create zipfile using ZipOutputStream and return it back as ByteArrayOutputStream. However currently wondering how can I assign a filename for the zip itself. Right now it will always be generated with the name…
OreoFanatics
  • 818
  • 4
  • 15
  • 32
1 2 3
11
12