Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ZlibѹËõËã·¨ÔÚjavaÉϵÄÓ¦ÓÃ

JAVAʵÏÖ
¡¡¡¡ÔÚJDKÖУ¬ÔÚjava.util.zip°üÖÐÒѾ­ÄÚÖÃÁËZLIBµÄʵÏÖ£¬Ê¾Àý´úÂëÈçÏ£º
1//½âѹ
2 public String decompressData(String encdata) {
3 try {
4 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
5 InflaterOutputStream zos = new InflaterOutputStream(bos); 
6 zos.write(convertfromBase64(encdata)); 
7 zos.close(); 
8 return new String(bos.toByteArray()); 
9 } catch (Exception ex) {
10 ex.printStackTrace(); 
11 return "UNZIP_ERR"; 
12 }
13 }
14
15 //ѹËõ
16 public String compressData(String data) {
17 try {
18 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
19 DeflaterOutputStream zos = new DeflaterOutputStream(bos); 
20 zos.write(data.getBytes()); 
21 zos.close(); 
22 return new String(convertToBase64(bos.toByteArray())); 
23 } catch (Exception ex) {
24 ex.printStackTrace(); 
25 return "ZIP_ERR"; 
26 }
27 }
²»¹ýÎÒAndroidÀïÃæInflaterOutputStreamºÃÏñ²»Ö§³Ö ÎÒ»¹Ã»Ïëµ½ÈçºÎÔÚandroidÀïʵÏÖ


Ïà¹ØÎĵµ£º

java ÃæÊÔÌâ

Java
»ù´¡·½Ãæ
:
1
¡¢
char
ÐͱäÁ¿ÖÐÄܲ»ÄÜ´æÖüÒ»¸öÖÐÎĺº×Ö
?
Ϊʲô
?
´ð£º
ÊÇÄܹ»¶¨Òå³ÉΪһ¸öÖÐÎĵģ¬ÒòΪjavaÖÐÒÔunicode±àÂ룬һ¸öcharÕ¼16×Ö½Ú£¬ËùÒÔ·ÅÒ»¸öÖÐÎÄÊÇûÎÊÌâµÄ
2:
À¬»ø»ØÊÕ»úÖÆ
,
ÈçºÎÓÅ»¯³ÌÐò

A:javaÖеÄÀ¬»øÊÕ¼¯
£¨Garbage Collection,GC£©ÓÃÀ´»ØÊÕÄÇЩ¹ýÈ¥·ÖÅäµÄ²»ÔÙÓ ......

java ÃæÊÔÌâ 2

Jsp
·½Ãæ
jspµÄ³£ÓõÄÃüÁî´ð£ºpage, include, talib, forward,
Servlet
·½Ãæ
1
¡¢ËµÒ»Ëµ
Servlet
µÄÉúÃüÖÜÆÚ
?
´ð:servletÓÐÁ¼ºÃ
µÄÉú´æÆڵĶ¨Ò壬°üÀ¨¼ÓÔغÍʵÀý»¯¡¢³õʼ»¯¡¢´¦ÀíÇëÇóÒÔ¼°·þÎñ½áÊø¡£Õâ¸öÉú´æÆÚÓÉjavax.servlet.Servlet½Ó¿ÚµÄ
init,serviceºÍdestroy·½·¨±í´ï¡£
2
¡¢
Servlet
°æ±¾¼ä
(
ÍüÁ ......

JAVA¶ÁÈ¡iniÎļþµÄÒ»¸öÀ࣬´æ×ÅÒÔ±¸ºóÓã¡

package com.qiao.java;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iter ......

java ²éѯ¿ÉÓÃÓòÃû

Õâ¶Îʱ¼äÔÚ×¢²áÓòÃû£¬ÔÛÆð²½Íí£¬ºÃÓõÄÓòÃû¶¼¸ø±ðÈË×¢²áÁË¡£
ÏëÕÒ¸öλÊýÉÙµÄ.comÓòÃû£¬¿ÉÊÇ·¢Ïִ󲿷ֶ¼×¢²áÁË£¬Ò²¾ÍÊÇ˵£¬ÎÒµã»÷µÄ¶à´Î²éѯ¶¼ÊÇÀË·Ñ¿¨Â·ÀÎҿɲ»Ïë¼õ·Ê£©
ÓÚÊÇ»¨Á˵ãʱ¼ä£¬ÓÃjavaдÁ˸ö¸ù¾ÝÖ¸¶¨Î»Êý²éѯËùÓпÉÓõÄ.comÓòÃûµÄС³ÌÐò¡£ÌṩԴÂëÏÂÔØ¡£
ÎÒÀûÓõÄÊÇwhoisÕâ¸öÓòÃû²éѯÍøվȡµÃÊý¾Ý£¬ÔÚ²âÊÔµ ......

Java Serialization transient

1. ʲôÊÇSerialization?
´®Ðл¯(Serialization)ÊǼÆËã»ú¿ÆѧÖеÄÒ»¸ö¸ÅÄËüÊÇÖ¸½«¶ÔÏó´æ´¢µ½½éÖÊ£¨ÈçÎļþ¡¢ÄÚÔÚ»º³åÇøµÈ£©ÖлòÊÇÒÔ¶þ½øÖÆ·½Ê½Í¨¹ýÍøÂç´«Êä¡£Ö®ºó ¿ÉÒÔͨ¹ý·´´®Ðл¯´ÓÕâЩÁ¬ÐøµÄλÊý¾ÝÖØй¹½¨Ò»¸öÓëԭʼ¶ÔÏó״̬ÏàͬµÄ¶ÔÏó£¬Òò´ËÔÚÌض¨Çé¿öÏÂÒ²¿ÉÒÔ˵Êǵõ½Ò»¸ö¸±±¾£¬µ«²¢²»ÊÇËùÓÐÇé¿ö¶¼ÕâÑù¡£
JavaÓÐS ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ