zip « API « Java I/O Q&A





1. How do you pipe an inputstream to a zipped file as it's read in with Java?    stackoverflow.com

I'm wanting to execute a program and as it runs read in it's output and pipe out the output into a zipped file. The output of the program can be ...

2. ZipInputStream doesn't report *actual* (i.e. compressed) bytes read    stackoverflow.com

Love this website! My issue is as follows: I'm reading a zip file that's coming over a network from an HTTP "PUT" request. The request header tells me that the ...

3. Issue with Zipped Streams from .Net and reading them from Java    stackoverflow.com

I'm trying to zip a stream from .Net that can be read from Java code. So as input I have a byte array, which I want to compress and I'm expecting to ...

4. How do I create an input stream from a ZipEntry    stackoverflow.com

I have a class which wraps ZipEntrys, but I'm struggling to see how I could then write a method that returns an input stream from any one ZipEntry. I managed to ...

5. Best way to detect if a stream is zipped in Java    stackoverflow.com

What is the best way to find out i java.io.InputStream contains zipped data?

6. Unzipping a file from InputStream and returning another InputStream in Java    stackoverflow.com

I am trying to write a function which will accept an InputStream with Zip file data and would return another InputStream with unzipped data. The Zip file will only contain a single ...

7. is it possible to get a zipentry's inputstream from a zipinputstream?    stackoverflow.com

I'm receiving a ZipInputStream from another source, and I need to provide the first entry's InputStream to another source. I was hoping to be able to do this without saving a temp ...

8. zip a folder structure using java    stackoverflow.com

I am trying to zip the following file structure on my machine,

parent/
parent/test1
parent/test1/image1.jpeg
parent/test2
The problem here is i cant zip the above file structure using java. I have google and found following code ...

9. Checking if a stream is a zip file    stackoverflow.com

We have a requirement to determine whether an incoming InputStream is a reference to an zip file or zip data. We do not have reference to the underlying source of the ...





10. ZipOutputStream doesn't write file contents    stackoverflow.com

I need to zip data that is coming from one stream and put zipped data to another. Here is the code that operates with files (MyOutputStream is a simple FileOutputStream wrapper ...

11. How to zip a file while writing to it?    stackoverflow.com

Does anyone know of a way to zip a stream that you are writing to? I'm trying to avoid writing the file to the disk, and was wondering if I can ...

12. Java: searching inside zips inside zips    stackoverflow.com

I've only fairly recently begun working with zip files in java. All seems to be going to plan pretty well so far but I have got one last roadblock: nested ...

13. Overwriting ZipEntrys    stackoverflow.com

Simple question, I'm writing a series of text files into a zip, just wrapping a fileoutputstream in a zipoutputstream and then in a printwriter.

public static int saveData(File outfile, DataStructure ...

14. Java: null comparison always yields false: incorrect warning?    stackoverflow.com

Interesting situation. I have a section of code that creates several ZipOutputStreams. As a safety check before I even think about writing anything I check thta my output streams ...

15. Java: Stream Contents of Zipfile via HTTP    stackoverflow.com

I have quite some amount of streamable data (>100MB), which, for the sake of compression, i would like to host packed in a zipfile on an http-server. So this zipfile contains ...

16. Zip files based on InputStreams    stackoverflow.com

I have a method to zip files in Java:

public void compress(File[] inputFiles, OutputStream outputStream) {

    Validate.notNull(inputFiles, "Input files are required");
    Validate.notNull(outputStream, "Output stream is required");

 ...





17. Zip Streams    coderanch.com

Hi All, Has anyone tried compressing the objects to transfer between client and server (to be specific Applet and a servlet)? I am working on certain applet-servlet communication where I have to transfer the data (objects) between applet/servlet. I am trying to use the Zip Streams. 1. when you put a byte array and pass it to the other side is ...

18. zip / pipedinputstream / pipedoutputstream problem    coderanch.com

Good Day people, I am having problems with the following method when processing multiple files. Situation is this... when the 3rd zip entry (3rd file of files param) is about to closed (targetStream.closeEntry() pls. see below), program hangs. Would this be a due to a prob with my use of the Piped classes? Would this be a thread issue? A nasty ...

19. how to zip file clubbing ZipOutputStream in Buffered writer    coderanch.com

hi i have a problem with the buffered writer in ziping the file. when i zip the file uing zipoutputstream i have clubbed the zipoutputstream with buffered writer so the i will not have a buffer problem,but the resulting zip file is corrupted . please help me out to zip the file using buffered writer thanks shiva

20. Getting an input stream for the contents of a Zip file inside a Zip file    coderanch.com

Hi; I need to step through a Zip file and get an input stream for each file archived. No problem. But if one of the files in there is also a Zip file I need to step through it and get inputstreams for all its content. My problem is this second Zip file doesn't have a path on the system so ...

22. Zipping an inputstream    coderanch.com

I'll take a stab... You want to compress the input stream coming in and pass it along as an InputStream? I'm thinking of something like a stream filter. Look at the piped I/O stream classes. Maybe you can construct a ZipOutputStream around a piped outputstream that's connect to a piped input stream that you pass along. The problem here is you ...

23. Possibility of using a zip streams to resolve the problem.    coderanch.com

Hello Experts and Friends, I have a problem with in my application now: The application has a feature of downloading the data(Based on the filter criteria in JSF page)as an XML file to client system, the devloper used xstream library for doing that. The dynamic sql which generates has a problem with more number of results which resulting timeouts, to avoid ...

24. writing .zip file into DataOutputStream    coderanch.com

25. generate large excel using zip stream    coderanch.com

hi i want to write the two string objects into the zip file. i am using the following code. public class DataToZip{ public static void main(String[] args) { try { String text = "In Xanadu did Kubla Khan A stately pleasure-dome decree: Where Alph, the sacred river, ran Through caverns measureless to man Down to a sunless sea."; substitute(new File("c:\\data.zip"), "c:\\book1.txt",text); ...

26. Help needed in writing zip file into response outputstream.    coderanch.com

Hi All, In our application, we can download files in 2 formats excel and ods (Open document spreadsheet). In implementation level: Excel format uses xml i.e. when a excel download is invoked it gets data from database (executing multiple complex queries). Here, each query result is written directly to response (output stream) i.e in the format which is readable by excel ...

27. ZIP reader    forums.oracle.com

29. Read Zip File and output it to the Stream    forums.oracle.com

Actually what I am trying to achieve is: Transfer data via HTTP. I will be provided a source location for the zip file which I would need to re transmit as Mime zip via servlet or jsp, as a stream. The output should be a stream (I guess some kind of outputStream) if someone knows how to do that please help. ...

30. Send and receive a zipped file with a character/text stream??    forums.oracle.com

Currently i need to configure my software to receive a zip file that is sent to me through sockets, i have no control over the senders application, but what i have discover so far is that it sends everything in text (even the binaries numbers that is supposed to send is sending then in text).

31. Zip streams?    forums.oracle.com

GZip streams make sense to me, but is there a point to these classes? I have used other classes in the util.zip package such as ZipFile and ZipEntry, and they're much more intuitive (IMO) than the Zip streams. Has anybody used ZipInput/OutputStream? If so, for what? Why did you choose that over ZipFile et al?

32. Class to unzip InputStream    forums.oracle.com

Hi Thanks for the reply. We tried to use ZipInputStream but we're having problems with zip files that contain files with accented characters. This bug exists in 1.4 and has not been corrected in this JDK. Also, I can't use the class like a simple InputStream, it has some limitation. So I have to load each file in memory and this ...