三九宝宝网宝宝百科宝宝知识

关于Java的解压缩的代码

02月02日 编辑 39baobao.com

[宽带连接错误代码651怎么解决]1、远程访问记事簿文件和当前的“网络和拨号连接”配置可能不一致如果更改了通讯设备(例如:串行口或调制解调器),请确保重新配置“网络和拨号连接”。如果错误仍然存在,请删除并...+阅读

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 package com.javatest.techzero.gui; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipInputStream; public class ZipFileDemo { SuppressWarnings("resource") public static void main(String args[]) throws Exception { File file = new File("d:" + File.separator + "test.zip"); File outFile = null; ZipFile zipFile = new ZipFile(file); ZipInputStream zipInput = new ZipInputStream(new FileInputStream(file)); ZipEntry entry = null; InputStream input = null; OutputStream out = null; while ((entry = zipInput.getNextEntry()) != null) { System.out.println("开始解压缩" + entry.getName() + "文件。。。"); outFile = new File("d:" + File.separator + entry.getName()); if (!outFile.getParentFile().exists()) { outFile.getParentFile().mkdir(); } if (!outFile.exists()) { outFile.createNewFile(); } input = zipFile.getInputStream(entry); out = new FileOutputStream(outFile); int temp = 0; while ((temp = input.read()) != -1) { //System.out.println(temp); out.write(temp); } input.close(); out.close(); } System.out.println("Done!"); } } 仅供参考

以下为关联文档:

错误代码651怎么解决啊宽带上网显示“错误651”是因为MODEM损坏,网线、网卡接触不良,电话线路障碍等原因引起,处理方法如下: 1.如有路由器,先断电重启,若仍不能使用,请去掉路由器进行下面操作检测; 2.检查...

651错误代码怎么解决朋友,你好: 导致电脑出现651代码,连不上网的原因很多,最常见的是三种情况: 首先建义用360网络修复功能(360断网急救箱)或者QQ管家工具箱中的“网络修复”功能,看能不能正常,无效的情...

西瓜影音怎么调用西瓜影音调用代码说明String.prototype.sub = function (n) { var r = /[^\x00-\xff]/g; if (this.replace(r, "mm").length // n = n - 3; var m = Math.floor(n / 2); for (var i = m; i if (thi...

PHP网页上打包文件生成压缩文件zip并弹出下载既然你只是想学习如何打包. 那我重点就回答你这一块,正好我刚刚用到; $filename = "./" . date ( 'YmdH' ) . ".zip"; // 最终生成的文件名(含路径)// 生成文件$zip = new ZipArchive...

谁能教我网页特效代码的使用啊把以下代码复制(即拷贝下来,再粘贴)到记事本,然后保存为文件: m泡与之间-->");document。write("○");}else{document。write("");document。write("○");}}elseif(ie4up){if(i==0){document。 w...

Java字符串压缩与解压public class Demo { public static void main(String[] args) { change(); change2(); } private static void change() { String str = "AAAbbbcc111NNNnn"; StringBuffer r...

java程序如何批量解压GZIP压缩给你一段单个文件解压gzip文件代码 批量解压的话 File f = new File("要解压的文件夹目录"); String paths[] = f.list(); // 取得文件夹下的文件 然后循环调用下面的方法就可以了...

请问您的那个java和c之间关于zip数据压缩和解压的问题解决了吗java用 Deflater compresser = new Deflater(); compresser.setInput(input); compresser.finish(); //压缩数据并返回压缩后的长度 int compressedDataLength =compresser....

怎样用java快速实现zip文件的压缩压缩package zip; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOu...

推荐阅读
图文推荐