public static byte[] fileToZip(){
ZipOutputStream append = null; ByteArrayOutputStream bos = new ByteArrayOutputStream(); try {
append = new ZipOutputStream(bos); ZipEntry e = new ZipEntry("request.xml");
append.putNextEntry(e);
append.write(filteToByte("G:\\tmp\\request.xml"));
append.closeEntry(); e = new ZipEntry("CONTENT\\content.xml");
append.putNextEntry(e);
append.write(filteToByte("G:\\tmp\\content.xml"));
append.closeEntry(); } catch (FileNotFoundException ex) {
Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
} finally{
if(null != append){
try {
append.close();
} catch (IOException ex) {
Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
}
}
} return bos.toByteArray();
}

最新文章

  1. mysql sql_safe_updates 不支持子查询的更新。
  2. Clr编写Insert Triggr
  3. C#操作oracle 到ExecuteNonQuery卡死不执行
  4. Java字符串处理函数
  5. PHP可变长函数方法介绍
  6. weimi 短信API post方式的简易代码。
  7. Eclipse中配置weka,以及添加算法
  8. 项目发布到Tomcat8中报错 “Resource is out of sync..."
  9. java中Comparable和Comparator两种比较器的区别
  10. 解决mysql漏洞 Oracle MySQL Server远程安全漏洞(CVE-2015-0411)
  11. 《高级软件测试》云平台Jira的配置
  12. c语言文件中关于while(!feof(fp)) 循环多输出一次的问题
  13. [Codeforces 940E]Cashback
  14. [BJOI2017]开车
  15. BootStrap学习之栅格布局
  16. Ansible条件测试
  17. Java第五次作业--面向对象高级特性(抽象类和接口)
  18. 1-为什么java的main方法必须是静态的
  19. 第一篇 C/C++基本语言类型
  20. c# HttpListener拒绝访问

热门文章

  1. CentOS 7 Tomcat服务的安装与配置
  2. [转]用chrome模拟微信浏览器访问需要OAuth2.0网页授权的页面
  3. SpringBoot整合Quartz定时任务 系统job Spring Boot教程 调度任务
  4. System.DllNotFoundException:“无法加载 DLL“librfc32.dll”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。”
  5. Java与C/C++的比较(转)
  6. Maven 默认插件以及功能
  7. vRealize 7中部署blueprint如果失败,如何不让已经被provision的虚机被删掉?
  8. iOS开发-UICollectionView实现瀑布流
  9. 【API规范】OpenAPI规范
  10. 基于CRF的中文分词