亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ziphelper.java

?? 手機(jī)郵箱撒的方式方式方式的
?? JAVA
字號(hào):
//#condition MUJMAIL_COMPRESSED_CONNECTION/* * Created on Jun 25, 2007 at 11:12:23 AM. *  * Copyright (c) 2007 Robert Virkus / Enough Software * * This file is part of J2ME Polish. * * J2ME Polish is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *  * J2ME Polish is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. *  * You should have received a copy of the GNU General Public License * along with J2ME Polish; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *  * Commercial licenses are also available, please * refer to the accompanying LICENSE.txt or visit * http://www.j2mepolish.org for details. */package mujmail.connections.gzip;import java.io.IOException;import java.io.InputStream;/** * <p>Provides some helper methods for ZipInputStream and ZipOutputStream.</p> * * <p>Copyright Enough Software 2007 - 2008</p> * <pre> * history *        Jun 25, 2007 - Simon creation * </pre> * @author Simon Schmitt, simon.schmitt@enough.de */public final class ZipHelper {		// constants:	public static final int[] LENGTH_CODE=	{	0	,	3	,	0	,	4	,	0	,	5	,	0	,	6	,	0	,	7	,	0	,	8	,	0	,	9	,	0	,	10	,	1	,	11	,	1	,	13	,	1	,	15	,	1	,	17	,	2	,	19	,	2	,	23	,	2	,	27	,	2	,	31	,	3	,	35	,	3	,	43	,	3	,	51	,	3	,	59	,	4	,	67	,	4	,	83	,	4	,	99	,	4	,	115	,	5	,	131	,	5	,	163	,	5	,	195	,	5	,	227	,	0	,	258	};	public static final int[] DISTANCE_CODE=	{	0	,	1	,	0	,	2	,	0	,	3	,	0	,	4	,	1	,	5	,	1	,	7	,	2	,	9	,	2	,	13	,	3	,	17	,	3	,	25	,	4	,	33	,	4	,	49	,	5	,	65	,	5	,	97	,	6	,	129	,	6	,	193	,	7	,	257	,	7	,	385	,	8	,	513	,	8	,	769	,	9	,	1025	,	9	,	1537	,	10	,	2049	,	10	,	3073	,	11	,	4097	,	11	,	6145	,	12	,	8193	,	12	,	12289	,	13	,	16385	,	13	,	24577	};		public static final int encodeCode(int[] Code , int distance){		int i=0;		//while(i<Code.length/2 && distance>=Code[i*2+1]){i++;}		while( i < (Code.length>>1) && distance >= Code[(i<<1)+1]){			i++;		}		// now: distance < Code[i*2+1]				return i-1;	}		    /**     * This function generates the huffmann codes according to a given set of bitlegth.     *      * @param huffmanCode			will be the resulting code pattern     * @param huffmanCodeLength		has to be the bitlegth for each code     */    public static final void genHuffTree(int[] huffmanCode, byte[] huffmanCodeLength){    	int maxbits=0;    	    	// generate bitlen_count    	for (int i = 0; i < huffmanCodeLength.length; i++) {    		int length = huffmanCodeLength[i];    		maxbits= maxbits > length ? maxbits : length;		}    	maxbits++;    	    	short[] bitlen_count = new short[maxbits];    	for (int i = 0; i < huffmanCodeLength.length; i++) {    		bitlen_count[huffmanCodeLength[i]]++;		}    	    	int code=0;    	int[] next_code=new int[maxbits];     	bitlen_count[0]=0;    	    	// find the Codes for each smallest Code within all of the same bitlength    	for (int bits = 1; bits < maxbits; bits++) {    		//code=(code + bitlen_count[bits-1])*2;    		code=(code + bitlen_count[bits-1])<<1;			next_code[bits]=code;		}    	// generate all codes by adding 1 to the predecessor    	for (int i = 0; i < huffmanCode.length; i++) {    		byte length = huffmanCodeLength[i];			if (length!=0){	    		huffmanCode[i]=next_code[length];	    		next_code[length]++;    		}		}    	    }        public final static void revHuffTree(int[] huffmanCode, byte[] huffmanCodeLength){    	// reverse all:    	int tmp;    	int reversed;    	for (int i = 0; i < huffmanCode.length; i++) {    		tmp=huffmanCode[i];    		reversed=0;    		for (int j = 0; j < huffmanCodeLength[i]; j++) {    			reversed|=((tmp>>>j)&1);    			reversed<<=1;			}    		huffmanCode[i] = reversed>>>1;		}    }    /**     * Generate the fixed huffman trees as described in the rfc      *      * @param huffmanCode - pointer to where the code shall be inserted     * @param huffmanCodeLength     * @param distHuffCode     * @param distHuffCodeLength     */    public final static void genFixedTree(int[] huffmanCode, byte[] huffmanCodeLength,    		int[] distHuffCode, byte[] distHuffCodeLength){    	    	int i;    	// huffmanCodes		for (i= 0; i <= 143; i++) {			huffmanCode[i]=48 + i; //48==00110000			huffmanCodeLength[i]=8;		}		for (i = 144; i <= 255; i++) {			huffmanCode[i]=400 + i-144; //400==110010000			huffmanCodeLength[i]=9;		}		for (i = 256; i <= 279; i++) {			huffmanCode[i]=i-256; //0==0			huffmanCodeLength[i]=7;		}		for (i = 280; i < 286; i++) {			huffmanCode[i]=192+i-280; //192==11000000			huffmanCodeLength[i]=8;		}		// reverse all:		ZipHelper.revHuffTree(huffmanCode, huffmanCodeLength);				// distHuffCode for non fixed DISTANCE tree		for (int j = 0; j < distHuffCode.length; j++) {			distHuffCode[j]=j;			distHuffCodeLength[j]=5;		}		// reverse all:		ZipHelper.revHuffTree(distHuffCode, distHuffCodeLength);	}        /**     * Compute the tree length according to the frequency of each code      *      * @param count      * @param huffmanCodeLength     * @param max_len      */    public static final void genTreeLength(int[] count, byte[] huffmanCodeLength, int max_len){    	int[] knotCount = new int[count.length];    	int[] knotPointer = new int[count.length];    	    	// initialise the knots    	for (short i = 0; i < count.length; i++) {    		if (count[i]!=0){    			knotCount[i]=count[i];    		}else{    			knotCount[i]=Integer.MAX_VALUE;    		}    		knotPointer[i]= i;		}    	    	// look for the smalest two knots    	int s1=0, s2=0;    	while(true){    			    	// find Min1 and Min2	    	if(knotCount[0]<knotCount[1]){	    		s1=0;	    		s2=1;	    	} else {	    		s1=1;	    		s2=0;	    	}	    	for (int i = 2; i < count.length; i++) {				if (knotCount[i]<knotCount[s1]){					s2=s1;					s1=i;				} else if (knotCount[i]<knotCount[s2]){					s2=i;				}			}	    				// if we got all Minima -> exit			if(knotCount[s2]== Integer.MAX_VALUE){				break;			}	    				// merge the knots			knotCount[s1]+=knotCount[s2];			int tmp=knotPointer[s2];			knotCount[s2]=Integer.MAX_VALUE;						// set all knot pointer of Min2 -> Min1,   add one to CodeLength, and remove old knots from search			for (int i = 0; i <count.length; i++) {				if(knotPointer[i]==tmp){					knotPointer[i]=knotPointer[s1];					huffmanCodeLength[i]++;				} else if (knotPointer[i]==knotPointer[s1]){					huffmanCodeLength[i]++;				}			}			    	}    	    	    	// check for overflow    	int overflowCount=0;    	for (int i = 0; i < huffmanCodeLength.length; i++) {    		if (huffmanCodeLength[i]>max_len) {    			overflowCount++;    		}		}    	// fix the overflow    	if (overflowCount!=0){    		//#debug    		System.out.println(" fixing " + overflowCount + " overflows  because of max=" + max_len);	    	    		// list the overflows    		short overflows[]= new short[overflowCount];	    	overflowCount=0;	    	for (short i = 0; i < huffmanCodeLength.length; i++) {	    		if (huffmanCodeLength[i]>max_len) {	    			overflows[overflowCount++]=i;	    		}			}	    	// find the index of the smalest node	    	int minNode=0;	    	for (int i = 0; i < huffmanCodeLength.length; i++) {				if (huffmanCodeLength[i]!=0 && huffmanCodeLength[minNode]>huffmanCodeLength[i]){					minNode=i;				}			}	    		    	// ok lets go and fix it....	    	int exendableNode;	    	int overflow1, overflow2;	    	while(overflowCount!=0){	    		exendableNode=minNode;	    		// find the largest expandable length	    		for (int i = 0; i < huffmanCodeLength.length; i++) {	    			if(huffmanCodeLength[i]<max_len && huffmanCodeLength[exendableNode]<huffmanCodeLength[i]){	    				exendableNode=i;	    			}				}	    			    		// find the deepest two overflows	    		overflow1=0;	    		overflow2=0;	    		for (int i = 0; i < overflows.length; i++) {	    			if(huffmanCodeLength[overflows[i]]> huffmanCodeLength[overflow1]){	    				overflow1=overflows[i];	    					    			} else if(huffmanCodeLength[overflows[i]]== huffmanCodeLength[overflow1]) {	    				overflow2=overflows[i];	    			}				}	    			    		// insert one of them at the best exendableNode	    		huffmanCodeLength[exendableNode]++;	    		huffmanCodeLength[overflow1]=huffmanCodeLength[exendableNode];	    			    		// lift the other one	    		huffmanCodeLength[overflow2]--;	    			        	// refresh the overflow count	        	overflowCount--;	        	if (huffmanCodeLength[overflow2]==max_len){	        		overflowCount--;	        	}	    	}    	}    	    }            /**     *  This function converts the representation of a huffman tree from     *  table to tree structure.     *       * @param huffmanCode	input     * @param huffmanCodeLength		input     * @param huffmanData	input     * @param huffmanTree   resulting tree     */    public static final void convertTable2Tree(int[] huffmanCode, byte[] huffmanCodeLength, int[] huffmanData, short[] huffmanTree){    	    	for (int i = 0; i < huffmanTree.length; i++) {    		huffmanTree[i]=0;		}    	    	short pointer;    	short nextNode=1;    	// fill each code in    	short j;    	for (short i = 0; i < huffmanCode.length; i++) {			if (huffmanCodeLength[i]!=0){				pointer=0;				for (j = 0; j < huffmanCodeLength[i]; j++) {										if(huffmanTree[pointer*2]==0){						// undefined internal NODE						huffmanTree[pointer*2]=nextNode++;						huffmanTree[pointer*2+1]=nextNode++;					} 					// go to known internal NODE					pointer=huffmanTree[pointer*2+ ((huffmanCode[i]>>>j)&1)];									}								// set empty LEAF to data				if (pointer<0){					//#debug error					System.out.println("error pointer=-1");				}				huffmanTree[pointer*2]=-1;				huffmanTree[pointer*2+1]=(short)huffmanData[i];			}		}    }    	/**	 * This function parses and pops one huffmancode out of the given buffer     * and returs the associated value.	 * 	 * @param smallCodeBuffer the buffer that is parsed	 * @param huffmanTree is the representation of the tree	 * @return the data represented by the parsed huffman code	 * @throws IOException	 */    public static final int deHuffNext(long[] smallCodeBuffer, short[] huffmanTree) throws IOException{    	    	if (smallCodeBuffer[1]<15){    		//#debug error    		System.out.println("smallCodebuffer is too small");    	}    	    	short pointer=0;    	    	while(huffmanTree[pointer*2]!=-1){			// go to next internal NODE			pointer=huffmanTree[pointer*2+ (int)(smallCodeBuffer[0]&1)];			smallCodeBuffer[0]>>>=1;			smallCodeBuffer[1]--;						if (pointer==0){		    	//System.out.println("small code buffer DAta "+smallCodeBuffer[0] + "\n");		    	// error: in walking tree no leaf found		    	throw new IOException("5");			}					}    	// return the data    	return huffmanTree[pointer*2+1];    }    /**     * This function skips the Gzip Header of a given stream.     * @param in the stream     * @throws IOException ocurrs if the stream is not readable     */	public static final void skipheader(InputStream in) throws IOException{		// check magic number and compression algorithm		if (in.read()!=31 || in.read()!=139 ||  in.read()!=8){			// wrong gzip header			throw new IOException("0");		}				int flag = in.read();		in.skip(6);				// skip FEXTRA		if((flag & 4)==4){			 in.skip( in.read() | in.read()<<8);		}		// skip FNAME		if((flag&8)==8){			while(in.read()!=0){				//			}		}		// skip FCOMMENT		if((flag&16)==16){			while(in.read()!=0){				//			}		}		// skip FHCRC		if((flag & 2)==2){			in.skip(2);		}			}	/**	 * In order to compute the CRC checksum fast it is crucial to 	 * have a precomputed table.	 * 	 * @param table store the table here	 */	private static final void initCrc32Table(int[] table){		int c;				int n,k;		for(n=0; n<256; n++){			c=n;			for(k=0; k<8;k++){				if((c&1)==1){					c=0xedb88320 ^ (c >>> 1);				} else{					c>>>=1;				}			}			table[n]=c;		}	}		/**	 *  This function computes / refreshes a crc32 checksum. 	 *  	 * @param table this is the precomputed crc32 table	 * @param crc set this value to zero if starting the computation	 * 				or to the last retrieved value when processing 	 * 				further data.	 * @param buffer the buffer to be walked	 * @param off the offset to start	 * @param len the amount of bytes to process	 * @return the new/refreshed crc checksum	 */	public static final int crc32(int[] table, int crc, byte[] buffer, int off, int len){		if (table[2]==0){			initCrc32Table(table);		}				crc = crc ^ 0xffffffff;				for(int n=0; n<len;n++){			crc=table[(crc^buffer[n+off]) & 0xff]^(crc>>>8);		}				return 0xffffffff ^ crc ;			}	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天堂蜜桃91精品| 欧洲一区二区三区在线| 国产一区在线观看麻豆| 精品夜夜嗨av一区二区三区| 日韩精品乱码免费| 麻豆精品在线看| 久久精品国产精品亚洲综合| 韩国午夜理伦三级不卡影院| 国产又黄又大久久| 成人综合婷婷国产精品久久免费| 丰满岳乱妇一区二区三区| 国产1区2区3区精品美女| 成人激情小说乱人伦| 99九九99九九九视频精品| 99re这里只有精品视频首页| 在线一区二区三区四区五区| 欧美性生活影院| 91精品国产综合久久香蕉麻豆| 日韩亚洲欧美在线观看| 日韩午夜中文字幕| 久久久久久亚洲综合| 国产精品亲子乱子伦xxxx裸| 亚洲精品国产第一综合99久久 | 91网上在线视频| 在线视频亚洲一区| 在线成人av网站| 亚洲一区二区三区四区在线免费观看 | 亚洲高清免费在线| 日本成人在线电影网| 精品亚洲国产成人av制服丝袜| 国产一区二区三区免费| av电影一区二区| 欧美精选午夜久久久乱码6080| 日韩欧美一级在线播放| 国产日本欧洲亚洲| 一区二区三区精品久久久| 日韩国产高清在线| 国产大片一区二区| 国产亚洲精品bt天堂精选| 日韩毛片在线免费观看| 午夜视频在线观看一区二区| 激情综合色播激情啊| 不卡av在线网| 欧美一区二区不卡视频| 国产精品乱人伦| 日本vs亚洲vs韩国一区三区 | 欧美日本精品一区二区三区| 日韩精品在线网站| 亚洲乱码国产乱码精品精可以看 | 亚洲激情中文1区| 精品无人码麻豆乱码1区2区| 色偷偷88欧美精品久久久| 日韩一区二区免费高清| 亚洲欧洲制服丝袜| 国产一区二三区好的| 91久久线看在观草草青青 | 久久精品国产一区二区三 | 日韩美女视频一区二区在线观看| 国产精品久久久久影院亚瑟| 亚洲444eee在线观看| 成人在线综合网站| 日韩三级视频在线看| 亚洲精品午夜久久久| 国产一区二区不卡在线| 欧美日韩在线电影| www.成人在线| 久久综合色天天久久综合图片| 亚洲精品视频免费看| 国产福利精品导航| 制服丝袜亚洲网站| 夜夜嗨av一区二区三区| 大白屁股一区二区视频| 精品成人免费观看| 天堂一区二区在线| 色综合久久综合| 国产精品美日韩| 国产麻豆精品视频| 日韩亚洲欧美在线| 视频在线在亚洲| 欧美综合一区二区三区| 综合久久久久综合| 丁香桃色午夜亚洲一区二区三区| 日韩欧美在线综合网| 亚洲福利视频一区| 一本在线高清不卡dvd| 欧美国产1区2区| 国产在线一区二区| 精品国产一区二区在线观看| 天天综合天天做天天综合| 在线免费一区三区| 国产精品色哟哟网站| 国产成人午夜精品5599| 精品国产伦理网| 麻豆国产精品一区二区三区 | 国产精品另类一区| 国产乱码精品一品二品| 精品久久久久一区二区国产| 首页国产欧美日韩丝袜| 欧美精品自拍偷拍动漫精品| 午夜一区二区三区在线观看| 欧美色图片你懂的| 亚洲综合一二区| 欧美性欧美巨大黑白大战| 亚洲日本青草视频在线怡红院| 波多野结衣91| 1024精品合集| 色老汉一区二区三区| 亚洲精品久久久蜜桃| 在线观看一区二区视频| 午夜视黄欧洲亚洲| 91麻豆精品国产无毒不卡在线观看| 日韩高清不卡在线| 欧美一区二区三区成人| 毛片一区二区三区| 欧美精品一区二区三区很污很色的| 精品综合久久久久久8888| 精品美女在线观看| 国产精品一区二区男女羞羞无遮挡| 久久久久久亚洲综合影院红桃| 国产成人午夜99999| 亚洲婷婷综合色高清在线| 在线观看视频一区二区欧美日韩| 亚洲不卡一区二区三区| 91精品综合久久久久久| 精品一区二区三区香蕉蜜桃 | 国产精品自拍网站| 中文子幕无线码一区tr| 972aa.com艺术欧美| 亚洲成年人影院| 精品99一区二区| av网站一区二区三区| 亚洲在线视频网站| 欧美videossexotv100| 国产999精品久久久久久绿帽| 自拍偷拍国产亚洲| 欧美日韩成人一区二区| 蜜臀av一区二区在线观看| 亚洲国产精品传媒在线观看| 91精品1区2区| 免费观看成人av| 国产精品电影一区二区三区| 一本到三区不卡视频| 免费在线观看一区二区三区| 国产婷婷色一区二区三区在线| 日本韩国欧美一区二区三区| 五月婷婷激情综合| 久久一区二区三区国产精品| 色系网站成人免费| 蜜臀久久99精品久久久久久9 | 久久精品国产精品亚洲精品| 国产精品欧美综合在线| 777xxx欧美| 成人黄色综合网站| 麻豆中文一区二区| 尤物视频一区二区| 久久综合视频网| 欧美日韩免费不卡视频一区二区三区| 久国产精品韩国三级视频| 亚洲欧美另类在线| 亚洲精品一区二区三区香蕉| 色欧美88888久久久久久影院| 麻豆国产精品官网| 尤物在线观看一区| 久久久久久久国产精品影院| 欧美少妇性性性| 成人午夜精品一区二区三区| 日韩电影在线观看网站| 中文字幕制服丝袜一区二区三区| 欧美一区二区三区婷婷月色| 色婷婷国产精品久久包臀| 国产高清不卡二三区| 青娱乐精品视频| 亚洲一区二区三区视频在线播放| 国产亚洲欧美激情| 3d动漫精品啪啪一区二区竹菊| 色综合网色综合| 岛国精品一区二区| 九色porny丨国产精品| 亚洲成人www| 夜夜嗨av一区二区三区| 中文字幕一区二区在线观看| 久久久久国产精品免费免费搜索| 91精品国产综合久久国产大片| 色婷婷亚洲婷婷| 成+人+亚洲+综合天堂| 国产美女一区二区| 美日韩一区二区| 日韩国产欧美三级| 亚洲高清免费在线| 亚洲一线二线三线视频| 国产精品久久看| 国产精品三级久久久久三级| 久久久99免费| 久久午夜羞羞影院免费观看| 欧美一区二区视频在线观看2022| 欧美在线你懂得| 欧亚洲嫩模精品一区三区| 99精品视频一区| 色综合久久久久网| 色偷偷久久人人79超碰人人澡|