import java.io.*;
import java.util.zip.*;
import com.macfaq.io.*;
public class FileDeflater {
public final static String DEFLATE_SUFFIX = ".dfl";
public static void main(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);
StreamCopier.copy(fin, dos);
dos.close();
fin.close();
}
catch (IOException e) {
System.err.println(e);
}
}
}
}
|