创建邮编
/** NowJava.com **/ //package com.nowjava; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class Main { private static final int BUFFER = 2048; public static void createZip(String[] files, String zipFile, String location) { BufferedInputStream origin = null; int count;// 来自 nowjava - 时代Java try { FileOutputStream dest = new FileOutputStream(zipFile); ZipOutputStream out = new ZipOutputStream( new BufferedOutputStream(dest)); byte data[] = new byte[BUFFER]; for (int i = 0; i < files.length; i++) { FileInputStream fi = new FileInputStream(files[i]); origin = new BufferedInputStream(fi, BUFFER); ZipEntry entry = new ZipEntry(files[i].substring(files[i] .lastIndexOf("/") + 1)); out.putNextEntry(entry);