日期:2014-05-20 浏览次数:20665 次
ZipOutputStream bos=null;
try{
ZipEntry entry=new ZipEntry("some.properties");
bos=new ZipOutputStream(new FileOutputStream("d:/some.zip"));
bos.putNextEntry(entry);
bos.write("id=192.168.1.1\r\n".getBytes());
bos.write("port=8080\r\n".getBytes());
bos.write("createTime=2012-08-16 13:30:50\r\n".getBytes());
bos.flush();
}catch(IOException e){
//xx00
}finally{
bos.close();
}