1 4 5 9 10 package org.openlaszlo.test; 11 12 import java.io.*; 13 import org.openlaszlo.utils.FileUtils; 14 15 public class gunzip { 16 static public void main (String args[]) { 17 try { 18 if (!args[0].endsWith(".gz")) { 19 System.err.println("filename must end with .gz"); 20 System.exit(-1); 21 } 22 File src = new File (args[0]); 23 String out = args[0].substring(0, args[0].length() - 3); 24 File dest = new File (out); 25 long then = System.currentTimeMillis(); 26 FileUtils.decode(src, dest, "gzip"); 27 long now = System.currentTimeMillis(); 28 System.out.println("wrote " + out + " in " + (now - then) + " msecs"); 29 } catch (Exception e) { 30 e.printStackTrace(); 31 } 32 } 33 } 34 | Popular Tags |