标签:turn next null name final ever evel ext div
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(); }
标签:turn next null name final ever evel ext div
原文地址:http://www.cnblogs.com/yshyee/p/7399713.html