Files handling, file->zip->process

Hello,

I am trying to make a simple coding programme. I have the encoding working, but I want first to zip the file I want to encode, do the encoding and then save it on the disk.

So the question is, how do I connect the GZIPOutputStream or some other with FileInputStream? I want to avoid running many loops and processing the data byte-after-byte. And how do I read the zipped data then?

[409 byte] By [kubeeka] at [2007-11-27 5:32:09]
# 1

>

> So the question is, how do I connect the

> GZIPOutputStream or some other with FileInputStream?

> I want to avoid running many loops and processing the

> data byte-after-byte.

You can use Buffers.

Take a look at http://java.sun.com/developer/technicalArticles/Programming/compression/

That's an article with code samples and honestly the code is all you will ever need for reading and writing ZipStreams in Java.

cotton.ma at 2007-7-12 14:58:00 > top of Java-index,Java Essentials,Java Programming...
# 2
This current Tech Tip also addresses writing zip/jar files and covers your question. http://java.sun.com/mailers/techtips/corejava/2007/tt0507.html#1
ChuckBinga at 2007-7-12 14:58:00 > top of Java-index,Java Essentials,Java Programming...