javaʵÏÖzipÓëunzip
jdkÌṩÁËZipÏà¹ØµÄÀà·½±ãµÄʵÏÖѹËõºÍ½âѹËõ¡£Ê¹Ó÷½·¨ºÜ¼òµ¥¡£Ï±߷ֱðÊÇѹËõºÍ½âѹËõµÄ¼òµ¥ÊÂÀý
1¡¢Ñ¹ËõµÄ
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class Zip {
static final int BUFFER = 2048;
public static void main(String argv[]) {
try {
BufferedInputStream origin = null;
FileOutputStream dest = new FileOutputStream("E:\\test\\myfiles.zip");
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(
dest));
byte data[] = new byte[BUFFER];
File f = new File("e:\\test\\a\\");
File files[] = f.listFiles();
for (int i = 0; i < files.length; i++) {
FileInputStream fi = new FileInputStream(files[i]);
origin = new BufferedInputStream(fi, BUFFER);
ZipEntry entry = new ZipEntry(files[i].getName());
out.putNextEntry(entry);
int count;
while ((count = origin.read(data, 0, BUFFER)) != -1) {
out.write(data, 0, count);
}
origin.close();
}
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
2¡¢½âѹµÄ
public void Unzip(String AbsoluteFilePath,String path){
try {
// String fileName = jTextField1.getText();
// String filePath = jTextField2.getText();
System.out.println("Unzip AbsoluteFilePath="+AbsoluteFilePath);
System.out.println("Unzip path="+path);
ZipFile zipFile = new ZipFile(AbsoluteFilePath);
Enumeration emu = zipFile.entries();
int i=0;
while(emu.hasMoreElements()){
Ïà¹ØÎĵµ£º
ÒÔÏÂÊÇ Java ÅжÏ×Ö·û´®ÊÇ·ñΪ¿ÕµÄÈýÖÖ·½·¨.
·½·¨Ò»: ×î¶àÈËʹÓõÄÒ»¸ö·½·¨, Ö±¹Û, ·½±ã, µ«Ð§ÂʺܵÍ.
·½·¨¶þ: ±È½Ï×Ö·û´®³¤¶È, ЧÂʸß, ÊÇÎÒÖªµÀµÄ×îºÃÒ»¸ö·½·¨.
·½·¨Èý: Java SE 6.0 ²Å¿ªÊ¼ÌṩµÄ·½·¨, ЧÂʺͷ½·¨¶þ¼¸ºõÏàµÈ, µ«³öÓÚ¼æÈÝÐÔ¿¼ÂÇ, ÍƼöʹÓ÷½·¨¶þ.
ÒÔÏ´úÂëÔÚÎÒ»úÆ÷ÉϵÄÔËÐнá¹û: (»úÆ÷ÐÔÄܲ»Ò», ½ö¹ ......
package day10;
import java.util.*;
public class MyLinkedList implements List
{
static class Node
{
public Object data;
public Node next;
public Node(Object data)
{
this.data=data;
}
}
private Node head;
public MyLinkedList()
{
head=new Node(0);
}
public void add(int ind ......
¹Ø¼ü×Ö: axis
ÓÉÓÚûѧϰ¹ý.net
£¬×î½ü³ÌÐòÖÐÐèÒªµ÷ÓÃ.net
µÄwebservice
½Ó¿ÚµÃµ½Ò»ÕÅͼƬ¡£ÔÚÍøÉÏÕÒÁ˺öà×ÊÁÏÑ¡ÓõÄaxisÀ´ÊµÏÖµ÷Óá£
Ê×ÏÈ¿´¿´.net
ʵÏÖWebmehodµÄÁ½ÖÖ·½Ê½£¬ÕâÁ½ÖÖ·½Ê½java
´«²ÎÊýµÄ·½Ê½Ò²Óв»Í¬
1.rpc·½Ê½£º
Java
´úÂë
using System;
using& ......
¡¡¡¡Ê×ÏÈÒýÓÃһƪÎÄÕ£¬½éÉÜÒ»¸ö¼òµ¥µÄJNIµÄµ÷ÓõĹý³Ì¡£¡¡¡¡JAVAÒÔÆä¿çƽ̨µÄÌØÐÔÉîÊÜÈËÃÇϲ°®£¬¶øÓÖÕýÓÉÓÚËüµÄ¿çƽ̨µÄÄ¿µÄ£¬Ê¹µÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ£¬Ô¼ÊøÁËËüµÄ¹¦ÄÜ¡£½â¾öJAVA¶Ô±¾µØ²Ù×÷µÄÒ»ÖÖ·½·¨¾ÍÊÇJNI¡£¡¡¡¡JAVAͨ¹ýJNIµ÷Óñ¾µØ·½·¨£¬¶ø±¾µØ·½·¨ÊÇÒÔ¿âÎļþµÄÐÎʽ´æ·ÅµÄ£¨ÔÚWINDOWSƽ̨ÉÏÊÇDL ......
package sort;
public class RadixSort {
// Çóx ÊýµÚdλÉϵÄÊý×Ö£¬ÀýÈç12345£¬Ê®Î»Êý×ÖÊÇ4 12345/10%10=4
// d=0 ±íʾ¸öλ £»d=1 ±íʾʮλ...ÒÀ´ÎÀàÍÆ
public static int digit(int d,int x){
return x/(int)Math.pow(10, d)%10;
}
public static void ra ......