FileDocCategorySizeDatePackage
FileDeflater.javaAPI DocExample695Fri Feb 10 12:59:18 GMT 2006None

FileDeflater

public class FileDeflater extends Object

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


       

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