标签:jin 目录 bytes hello exception byte 内容 压缩包 pen
public static void saveZipFile(){
try {
ZipOutputStream zipout = new ZipOutputStream(new FileOutputStream("E:\\wangjing.zip"));
zipout.setEncoding("utf8");
zipout.putNextEntry(new ZipEntry("aaa/aa.json"));//往压缩包里添加aaa目上录和aaa目录下的aa.json,并将helloworld写入aaa.json
zipout.write("helloworld".getBytes());
zipout.close();
} catch (Exception e) {
e.printStackTrace();
}
}
标签:jin 目录 bytes hello exception byte 内容 压缩包 pen
原文地址:http://www.cnblogs.com/wangjing666/p/7642220.html