Java zip 解压缩API
参数说明
fileName: 表示想解压的文件名 如:c:\\aaa\a.zip
unZipDir: 表示想解压到的路径 如:c:\\ccc
public static void unZip1(String fileName, String unZipDir) {
try {
File f = new File(unZipDir);
if (!f.exists()) {
f.mkdirs();
}
BufferedOutputStream dest = null;
BufferedInputStream is = null;
ZipEntry entry;
ZipFile zipfile = new ZipFile(fileName);
Enumeration e = zipfile.entries();
while (e.hasMoreElements()) {
entry = (ZipEntry) e.nextElement();
if (entry.isDirectory()) {
makeDir(unZipDir + File.separator + entry.getName());
} else {
is = new BufferedInputStream(zipfile.getInputStream(entry));
int count;
byte data[] = new byte[BUFFER];
&nbs
相关文档:
ava IO学习笔记:概念与原理
一、概念
Java中对文件的操作是以流的方式进行的。流是Java内存中的一组有序数据序列。Java将数据从源(文件、内存、键盘、网络)读入到内存中,形成了流,然后将这些流还可以写到另外的目的地(文件、内存、控制台、网络),之所以称为流,是因为这个数据序列在不同时刻所操 ......
package Utils.Sort;
/**
*利用选择排序法对数组排序,数组中元素必须实现了Comparable接口。
*/
public class ChooseSort implements SortStrategy
{
/**
*对数组obj中的元素以选择排序算法进行排序
&n ......
package Utils.Sort;
/**
*希尔排序,要求待排序的数组必须实现Comparable接口
*/
public class ShellSort implements SortStrategy
{
private int[] increment;
/**
*利用希尔排序算法对数组ob ......
package Utils.Sort;
/**
*快速排序,要求待排序的数组必须实现Comparable接口
*/
public class QuickSort implements SortStrategy
{
private static final int CUTOFF = 3; //当元素数大于此 ......