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

How to write a Zip File with the "DFLT-X" Method

I am working on a Software which bundles and exports XML files as a zip. The compression method is "Deflate" (Code snipped included below). These zip files are needed in another (older) Software, which is build up on "QT" (Code snipped also…
simon
  • 73
  • 6
0
votes
1 answer

After File compression I lost the Filename extension

I am trying to compress my file using the ZipOutPutStream. I tried below code and got the compressed folder with the file. But when I am extracting the folder using 7Zip, the fileName extension is missing. Also I am unable to extract the folder by…
0
votes
1 answer

How to convert byte array to ZipOutputStream in spring MVC?

Trying to read a zip file stored in a database as a byte array. .zip is getting downloaded using the following code but the size of files included in the zip is none. No data is there. I already went through lots of answers but not sure what's…
Amol Patil
  • 985
  • 2
  • 11
  • 43
0
votes
1 answer

Loop through 3 different JDBC resultsets

I am trying to zip 3 CSV files from 3 different tables in single zip file your_files_12354627.zip. So, I've the following method which works fine for zip file generation with 1 csv file in it. I'm trying to do this for multiple files and hence I've…
Tan
  • 1,433
  • 5
  • 27
  • 47
0
votes
2 answers

Zip file not getting generated

I have this method in my springboot application which is generating 3 CSV files (related to Employee, Customer and Building) inside custom_users directory with timestamp appended to its name as shown below. Right now it's only generating two CSV…
Tan
  • 1,433
  • 5
  • 27
  • 47
0
votes
0 answers

how to create multiple folder as stream to ZIP in java6

we have below sample code which will a create zip file, but we have a scenario to add 100 samplefolder with various file size in each void createzipfile() { Map < String, byte[] > outputMap = new HashMap < String, byte[] > (); // will be 100…
senthil kumar
  • 237
  • 1
  • 6
  • 18
0
votes
1 answer

move csv data to zip archive as zipentry objects- constructor ZipEntry(Path) is undefined

I have this method in my springboot application which is generating 3 CSV files (related to Employee, Customer and Building) inside custom_users directory with timestamp appended to its name as shown below. The following code works fine for…
Tan
  • 1,433
  • 5
  • 27
  • 47
0
votes
0 answers

Get image saved in vb.net and ICSharpCode.SharpZipLib.Zip.ZipInputStream in PHP

I'm stuck integrating data produced in VB.net to a new php application. I got two function for compress and uncompress data (eg. image): ''' ''' Compress data into zip ''' ''' input byte array '''…
Tiziano
  • 23
  • 6
0
votes
1 answer

How to programmatically zip a file in Android?

I know this question already exists, but I'm not sure how to implement it in my case... First I created an DataOutuputStream that will write in a file with .uedl extension: private static DataOutputStream os; public static final String BASE_PATH =…
joe
  • 1,341
  • 4
  • 21
  • 32
0
votes
0 answers

Not able to zip file in java using zipOutputStream?

Actually I was trying to zip files using zipOutputStream but everytime it is not able to zip files properly. It gets stuck at a particular file of bigger size. My code looks like below: byte[] buf = new byte[1600*1024]; long…
Sarwan
  • 595
  • 3
  • 8
  • 21
0
votes
0 answers

How to download PDDocument as zip file (PDFBOX)

How to download PDDocument for example, PDDocument has has 10 pages with document name as Test and now this has to downloaded as zip file inside should PDF doc as Test1, Test2... Test10 in a zip file named Test.zip. ByteArrayOutputStream…
0
votes
1 answer

Create a File from a ZipOutputStream

I am using the below code to create a Zip file. I would like to return the created Zip as a File object in the method createZipFromFiles in order to use elsewhere. Can this be done from the FileOutputStream or ZipOutputStream? public File…
MisterIbbs
  • 247
  • 1
  • 7
  • 20
0
votes
1 answer

Is there a way in Java to preserve Created and Accessed attributes of a file when are added to a zip archive?

I could handle the Modified (lastModified) attribute, meaning in the archive I could preserve the Modified attribute of the file. Here is a sample: ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream( new…
PinkSheep
  • 415
  • 2
  • 4
  • 12
0
votes
1 answer

Add Inner Zip entries to zip file

I want somehow to add files into inner zip entry. Following structure of zip file looks like this: input-zip-file |-- directory/ | |-- zipfile.zip - | | |-- files.txt - *How can i get these entries to my zipfile.zip* | | |--…
0
votes
2 answers

Write object to zip file in json format

My goal is to write an object to zip file in json format. The simplest way of doing it is: ZipOutputStream zip = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFile))); String json =…
lukasz
  • 41
  • 2
  • 6