标签:style blog color io os java ar 文件 2014
压缩文件
public static void main(String[] args) throws IOException { String filePath = "E:\\技术部员工工作"; ZipOutputStream outputStream = new ZipOutputStream(new FileOutputStream("E:\\技术部员工工作\\aaa.zip")); ZipEntry entry = new ZipEntry("dadsa.txt"); byte[] d = FileUtils.readFileToByteArray(new File(filePath + "\\20140417.txt")); outputStream.putNextEntry(entry); outputStream.write(d); outputStream.closeEntry(); //outputStream.closeEntry(); ZipEntry entry1 = new ZipEntry("da1dsa.txt"); byte[] d1 = FileUtils.readFileToByteArray(new File(filePath + "\\20140916.txt")); outputStream.putNextEntry(entry1); outputStream.write(d1); outputStream.closeEntry(); outputStream.finish(); outputStream.close(); }
标签:style blog color io os java ar 文件 2014
原文地址:http://www.cnblogs.com/daxin/p/3978829.html