How can I programmatically uncompress a file that has been compressed using GZIP?

Location: http://www.jguru.com/faq/view.jsp?EID=228417 Created: Oct 13, 2000 Modified: 2001-08-18 18:26:26.545 Author: Tim Rohaly (http://www.jguru.com/guru/viewbio.jsp?EID=10) The java.util. Zip package has classes which let you do this. Here is a program using these classes that will GZIP-uncompress a file: import java.io.

*; import java.util.zip. *; public class gunzip { public static void main(String args) { try { if (args. Length!

= 1) { System.out. Println("Usage: java gunzip "); System. Exit(1); } String filename = null; if (args0.

EndsWith(". Gz")) { filename = args0. Substring(0, args0.

LastIndexOf(". Gz")); } else { System.out. Println("Inputfile must have extension .

Gz"); System. Exit(1); } FileOutputStream out = new FileOutputStream(filename); System.out. Println("Extracting archive " + args0); System.out.

Println(""); FileInputStream file = new FileInputStream(args0); GZIPInputStream in = new GZIPInputStream(file); byte data = new byte2048; int len; while (( ... more.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions