压缩文件
//package com.nowjava; import java.io.*; /** 来 自 时代Java **/ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class Main { public static void zipFile(File inputFile, File outputZip) { byte[] buffer = new byte[1024]; try { FileOutputStream fos = new FileOutputStream(outputZip); ZipOutputStream zos = new ZipOutputStream(fos); ZipEntry ze = new ZipEntry(inputFile.getName()); zos.putNextEntry(ze); FileInputStream in = new FileInputStream(inputFile);/**来 自 N o w J a v a . c o m**/ int len; while ((len = in.read(buffer)) > 0) { zos.write(buffe