private static String zifDir = "e:/zipfile/";public ZipOutputStream zipFile(List<ZipFileItem> items) throws Exception{String filePath = zifDir + UUID.randomUUID().toString()+".zip";FileOutputStream fileOutputStream = new FileOutputStream(filePath);ZipOutputStream zip = new ZipOutputStream(fileOutputStream);int count = -1;byte buff[] = new byte[1024];for (ZipFileItem item : items) {try {ZipEntry entry = new ZipEntry(item.getName());zip.putNextEntry(entry);while((count = item.getIs().read(buff)) != -1){zip.write(buff,0,count);}item.getIs().close();}catch (Exception e){e.printStackTrace();}}return zip;}ALTER TABLE test ADD camera_wifi VARCHAR(255);ALTER TABLE test ADD camera_wifi_password VARCHAR(255);ALTER TABLE test ADD bluetooth_code VARCHAR(255);ALTER TABLE test ADD pad_bluetooth_code VARCHAR(255);ALTER TABLE test ADD pad_os_name VARCHAR(255);private static class ZipFileItem{private String name;private InputStream is;public String getName() {return name;}public void setName(String name) {this.name = name;}public InputStream getIs() {return is;}public void setIs(InputStream is) {this.is = is;}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。