FileDocCategorySizeDatePackage
GZipper.javaAPI DocExample649Fri Feb 10 12:59:42 GMT 2006None

GZipper

public class GZipper extends Object

Fields Summary
public static final String
GZIP_SUFFIX
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)


       

    for (int i = 0; i < args.length; i++) {
      try {
        InputStream fin = new FileInputStream(args[i]);      
        OutputStream fout = new FileOutputStream(args[i] + GZIP_SUFFIX);
        GZIPOutputStream gzout = new GZIPOutputStream(fout);
        for (int c = fin.read(); c != -1; c = fin.read()) {
          gzout.write(c);
        }
        gzout.close();
      }
      catch (IOException ex) {
        System.err.println(ex);
      }
    }