JSONÓëJAVAÊý¾ÝµÄת»»
¹Ø¼ü×Ö: json java
JSON-libÕâ¸öJavaÀà°üÓÃÓÚ°Ñbean,mapºÍXMLת»»³ÉJSON²¢Äܹ»°ÑJSONת»Ø³ÉbeanºÍDynaBean¡£
ÏÂÔصØÖ·:http://json-lib.sourceforge.net/
»¹ÒªÐèÒªµÄµÚ3·½°ü:
org.apache.commons(3.2ÒÔÉÏ°æ±¾)
org.apache.oro
net.sf.ezmorph(ezmorph-1.0.4.jar)
nu.xom
1¡¢List
Java´úÂë
boolean[] boolArray = new boolean[]{true,false,true};
JSONArray jsonArray1 = JSONArray.fromObject( boolArray );
System.out.println( jsonArray1 );
// prints [true,false,true]
List list = new ArrayList();
list.add( "first" );
list.add( "second" );
JSONArray jsonArray2 = JSONArray.fromObject( list );
System.out.println( jsonArray2 );
// prints ["first","second"]
JSONArray jsonArray3 = JSONArray.fromObject( "['json','is','easy']" );
System.out.println( jsonArray3 );
&
Ïà¹ØÎĵµ£º
1.Base64
¼ÓÃÜ£ºorg.apache.commons.codec.binary.Base64.encodeBase64(byte[] binaryData)
½âÃÜ£ºorg.apache.commons.codec.binary.Base64.decodeBase64(byte[] base64Data)
2.Md5
¼ÓÃÜ£ºorg.apache.commons.codec.digest.md5Hex(byte[] data)
½âÃÜ£ºÎÞ
3.DES£¨des-ecb,3des,des-cbc,cb ......
1.InputStreamºÍOutputStreamÊÇÓÃÓÚ¶Á»òдµ¥¸ö×Ö½Ú»òÕß×Ö½ÚÊý×飬ÎÒÃǺÜÉÙÓõ½ËüÃǵķ½·¨£¬ËüÃÇÖ®ËùÒÔ´æÔÚÊÇÒòΪ±ðµÄÀà¿ÉÒÔʹÓÃËüÃÇ£¬ÒÔ±ãÌṩ¸üÓÐÓõĽӿڡ£Òò´Ë£¬ÎÒÃǺÜÉÙʹÓõ¥Ò»µÄÀàÀ´´´½¨Á÷¶ÔÏ󣬶øÊÇͨ¹ýµþºÏ¶à¸ö¶ÔÏóÀ´ÌṩËùÆÚÍûµÄ¹¦ÄÜ¡£
2.FilterInputStreamºÍFilterOutputStreamÊÇÓÃÀ´ÌṩװÊÎÆ÷Àà½Ó¿ÚÒÔ¿ØÖÆÌض¨ ......
ÍøÂçµÄ¸ÅÄî:Ï໥Á¬½Ó,¶ÀÁ¢×ÔÖ÷
ÍøÂçÓë·Ö²¼Ê½¼¯ÈºÏµÍ³µÄÇø±ð£ºÃ¿¸ö½Úµã¶¼ÊÇһ̨¼ÆËã»ú£¬¶ø²»ÊǸ÷ÖÖ¼ÆËã»úÄÚ²¿µÄ¹¦ÄÜÉ豸¡£
Ip:¾ßÓÐÈ«ÇòΨһÐÔ£¬Ïà¶ÔÓÚinternet£¬IPΪÂß¼µØÖ·£¬TCP/IPÍøÂçÖеÄÿ̨¼ÆËã»ú¶¼ÓÐΨһµÄµØÖ·--IPµØÖ·. Ψһ±êʾһ̨Ö÷»ú
ÔÚJavaÖÐ,ÓÐÒ»¸öÓÃÀ´´æ´¢internetµØÖ·µÄÀà½ÐInetAddress.
Àý:»ñÈ¡±¾» ......
Java
ÐéÄâ»ú(JVM)ÊÇ¿ÉÔËÐÐJava
´úÂëµÄ¼ÙÏë¼ÆËã»ú¡£Ö»Òª¸ù¾ÝJVM¹æ¸ñÃèÊö½«½âÊÍÆ÷ÒÆÖ²µ½Ìض¨µÄ¼ÆËã»úÉÏ£¬¾ÍÄܱ£Ö¤¾¹ý±àÒëµÄÈκÎJava´úÂëÄܹ»ÔÚ¸ÃϵͳÉÏÔËÐС£±¾ÎÄÊ×ÏȼòÒª½éÉÜ´ÓJavaÎļþµÄ±àÒëµ½×îÖÕÖ´ÐеĹý³Ì£¬Ëæºó¶ÔJVM¹æ¸ñÃèÊö×÷һ˵Ã÷¡£
¡¡¡¡
¡¡¡¡Ò».JavaÔ´ÎļþµÄ±àÒë¡¢ÏÂÔØ
¡¢½âÊͺÍÖ´ÐÐ
¡¡¡¡JavaÓ¦ÓóÌÐòµÄ¿ª·¢ ......
java ipµØַת»»Îª³¤ÕûÐÍ£»
public class Util {
/**
* ×Ö·û´®ipת»»Îªlong
* @param ×Ö·û´®ip
* @return
*/
public static long getStr ......