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

Saving ZipOutputStream to zip file with Java

I have to create ZIP archive in memory But now, I need it to be saved in a real .zip file in a disk. How to do it? Pseudocode: public byte[] crtZipByteArray(ByteArrayInputStream data,ZipEntry entry) throws IOException{ ByteArrayOutputStream…
Serg88
  • 41
  • 2
  • 3
2
votes
1 answer

C# ZipOutputStream getting invalid files from output stream

I've been playing around with C#'s SharpZip Library (version 0.86.0). I'm basically using it to package a number of files into one clean zip files. Here's what my function looks like to do generate the byte array of the zip file: public static…
mBrice1024
  • 790
  • 5
  • 25
2
votes
0 answers

XSSFWorkbook write method closing output steam implicitly

Hi I'm uploading msexcel 2007 and after evaluation I'm zipping multiple XSSFWorkbooks to a single zip file. On writing my workbook to file it is implicitly closing outputsteam but I want more entries to be created in zip file.On calling method…
Barney
  • 193
  • 1
  • 2
  • 11
2
votes
0 answers

Multiple files into a single ZIP using XSSFWorkbook

I'm able to read from multiple files and create a ZIP, however, I'd like to create an XLS file(or two, for that matter) on-the-fly and ZIP them. My original requirement is to give the user a set of dynamically generated XLS files in a single…
Vikash
  • 41
  • 5
2
votes
1 answer

Convert ZipOutputStream to FileInputStream

i have a code that takes a file, zip it, and stores it in a database looks like this // STEP 1 - Create a ZIP file byte[] buffer = new byte[1024];// 18024 ZipOutputStream outZip = new ZipOutputStream(new…
yaniv
  • 152
  • 5
  • 15
2
votes
1 answer

Insert File To An Existed .APK

I need to add some resource files to an existed .APK file. I wrote a program in Java Se which using ZipInputStream and ZipOutputStream to insert files into assets/myfiles and it works perfectly but when I want to install my new .APK file on my…
2
votes
1 answer

How to encrypt a ZipOutputStream in Google appengine?

I am creating zip files in GAE with Java, using ZipOutputStream to upload them to Google Cloud Storage. However I need to encrypt the files but I don't know how. Does anyone know how to encrypt a ZipOutputStream in Google Appengine?
2
votes
3 answers

Adding files to ZIP file

I am trying to add some files to a ZIP file, it creates the file but does not add anything into it. Code 1: String fulldate = year + "-" + month + "-" + day + "-" + min; File dateFolder = new File("F:\\" + compname + "\\" +…
cheese5505
  • 962
  • 5
  • 14
  • 30
1
vote
4 answers

Way to close specific output streams

Do you think this code close correctly the output stream entry ? Knowing that this is not the same type of output stream. OutputStream out = new JarOutputStream(new FileInputstrem(fileName)); …
damson
  • 2,635
  • 3
  • 21
  • 29
1
vote
0 answers

StreamingResponseBody with ZipOutputStream to WebFlux and reactive programming

In my application (Spring MVC) I have a legacy endpoint returning a ResponseEntity. The StreamingResponseBody is basically a ZipOutputStream built by fetching a list of documents in a S3 storage. Omitting some parts, the code…
Bapt_
  • 71
  • 1
  • 8
1
vote
2 answers

Java download zip file with HTTPResponse works at localhost but failed at server

I've created a download button to get a zip file of product photos. It works fine when testing in localhost but doesnt work after deployed to server. No zip file was created and there're no error message in both web console and catalina log, nothing…
A.T.
  • 11
  • 2
1
vote
1 answer

Save HTTP Entity ZIP response in Java

I am testing a framework in which I download zip file trough HTTP Get. I use Apache HttpClient for that. I am having hard time saving a response that is a zip file. I tried just Output Stream pointing to the path that end with ".zip" but it is not…
Ver Siw
  • 11
  • 2
1
vote
2 answers

Creating a zip response without actually creating all the files in the machine

The main endpoint in my program manipulates lot's of data and eventually creates Zip file, which contains parent directory with a few sub directories and a few files(splitted between the sub directories). After sending the zip back to the client,…
Ecalipso
  • 11
  • 3
1
vote
3 answers

Java - ZipOutputStream within try-with-resources

I have this Java code that creates and saves a zip file with a text file inside it: public static void main(String[] args) { try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); ZipOutputStream zos = new ZipOutputStream(baos))…
thwomp68
  • 125
  • 1
  • 2
  • 9
1
vote
1 answer

How to completely abort the output stream download?

we're currently working on the service that would archive the data and return it to the user as a ZipOutputStream. What we're currently looking for is an option to completely terminate the operation if something goes wrong on the server side. With…
ZeeG
  • 33
  • 7