01: /* *****************************************************************************
02: * gzip.java
03: * ****************************************************************************/
04:
05: /* J_LZ_COPYRIGHT_BEGIN *******************************************************
06: * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
07: * Use is subject to license terms. *
08: * J_LZ_COPYRIGHT_END *********************************************************/
09:
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 args[]) {
17: try {
18: File src = new File(args[0]);
19: String 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)
25: + " msecs");
26: } catch (Exception e) {
27: e.printStackTrace();
28: }
29: }
30: }
|