KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > test > gzip


1 /* *****************************************************************************
2  * gzip.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.test;
11
12 import java.io.*;
13 import org.openlaszlo.utils.FileUtils;
14
15 public class gzip {
16    static public void main (String JavaDoc args[]) {
17        try {
18            File src = new File (args[0]);
19            String JavaDoc out = args[0] + ".gz";
20            File dest = new File (out);
21            long then = System.currentTimeMillis();
22            FileUtils.encode(src, dest, "gzip");
23            long now = System.currentTimeMillis();
24            System.out.println("wrote " + out + " in " + (now - then) + " msecs");
25        } catch (Exception JavaDoc e) {
26            e.printStackTrace();
27        }
28    }
29 }
30
Popular Tags