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

cºÍjavaÖеĶþ½øÖÆÎļþ


×î½üÐèҪдһ¶Î³ÌÐò£¬Íê³ÉÒÔÏµĹ¤×÷£¬ÓÃjava½«Êý¾ÝÒÔ¶þ½øÖƵÄÐÎʽдÈëÎļþÖУ¬È»ºóÓÃC¶Á³ö´Ë¶þ½øÖÆÎļþ¡£
¿ªÊ¼µÄʱºòûÓп¼ÂÇ»úÆ÷µÄ×Ö½ÚÐò£¬Ö±½Ó¸ã³ösegment fault.ÏëÁ˺ܾ㬲ÅÃ÷°×Ô­À´ÊÇjavaºÍCµÄ×Ö½ÚÐòÊDz»Ò»ÑùµÄ¡£
javaÖеÄ×Ö½ÚÐòÊÇbig endianµÄ£¬ËüÊÇÓë»úÆ÷Î޹صġ£¶øcµÄ×Ö»úÐòÊÇ»úÆ÷Ïà¹ØµÄ£¬¶øµ±Ç°ÓõĻúÆ÷ÊÇx84_64½á¹¹£¬ÊÇlittle endianµÄ£¬
ËùÒÔ³ö´í¾Í²»×ãΪÆæÁË¡£
±³¾°ÖªÊ¶£º
Ö÷»ú×Ö½ÚÐò
²»Í¬µÄCPUÓв»Í¬µÄ×Ö½ÚÐòÀàÐÍ ÕâЩ×Ö½ÚÐòÊÇÖ¸ÕûÊýÔÚÄÚ´æÖб£´æµÄ˳Ðò Õâ¸ö½Ð×öÖ÷»úÐò
×î³£¼ûµÄÓÐÁ½ÖÖ
1£® Little endian£º½«µÍÐò×Ö½Ú´æ´¢ÔÚÆðʼµØÖ·
2£® Big endian£º½«¸ßÐò×Ö½Ú´æ´¢ÔÚÆðʼµØÖ·
LE little-endian
×î·ûºÏÈ˵Ä˼άµÄ×Ö½ÚÐò
µØÖ·µÍλ´æ´¢ÖµµÄµÍλ
µØÖ·¸ßλ´æ´¢ÖµµÄ¸ßλ
Ôõô½²ÊÇ×î·ûºÏÈ˵Ä˼άµÄ×Ö½ÚÐò£¬ÊÇÒòΪ´ÓÈ˵ĵÚÒ»¹Û¸ÐÀ´Ëµ
µÍλֵС£¬¾ÍÓ¦¸Ã·ÅÔÚÄÚ´æµØַСµÄµØ·½£¬Ò²¼´ÄÚ´æµØÖ·µÍλ
·´Ö®£¬¸ßλֵ¾ÍÓ¦¸Ã·ÅÔÚÄÚ´æµØÖ·´óµÄµØ·½£¬Ò²¼´ÄÚ´æµØÖ·¸ßλ
BE big-endian
×îÖ±¹ÛµÄ×Ö½ÚÐò
µØÖ·µÍλ´æ´¢ÖµµÄ¸ßλ
µØÖ·¸ßλ´æ´¢ÖµµÄµÍλ
Ϊʲô˵ֱ¹Û£¬²»Òª¿¼ÂǶÔÓ¦¹Øϵ
Ö»ÐèÒª°ÑÄÚ´æµØÖ·´Ó×óµ½ÓÒ°´ÕÕÓɵ͵½¸ßµÄ˳Ðòд³ö
°ÑÖµ°´ÕÕͨ³£µÄ¸ßλµ½µÍλµÄ˳Ðòд³ö
Á½Õ߶ÔÕÕ£¬Ò»¸ö×Ö½ÚÒ»¸ö×Ö½ÚµÄÌî³ä½øÈ¥
Àý×Ó£ºÔÚÄÚ´æÖÐË«×Ö0x01020304(DWORD)µÄ´æ´¢·½Ê½
ÄÚ´æµØÖ·
4000 4001 4002 4003
LE 04 03 02 01
BE 01 02 03 04
Àý×Ó£ºÈç¹ûÎÒÃǽ«0x1234abcdдÈëµ½ÒÔ0x0000¿ªÊ¼µÄÄÚ´æÖУ¬Ôò½á¹ûΪ
big-endian little-endian
0x0000 0x12 0xcd
0x0001 0x23 0xab
0x0002 0xab 0x34
0x0003 0xcd 0x12
x86ϵÁÐCPU¶¼ÊÇlittle-endianµÄ×Ö½ÚÐò.
ÍøÂç×Ö½ÚÐò
ÍøÂç×Ö½Ú˳ÐòÊÇTCP/IPÖй涨ºÃµÄÒ»ÖÖÊý¾Ý±íʾ¸ñʽ£¬ËüÓë¾ßÌåµÄCPUÀàÐÍ¡¢²Ù×÷ϵͳµÈÎ޹أ¬´Ó¶ø¿ÉÒÔ±£Ö¤Êý¾ÝÔÚ²»Í¬Ö÷»úÖ®¼ä´«ÊäʱÄܹ»±»ÕýÈ·½âÊÍ¡£ÍøÂç×Ö½Ú˳Ðò²ÉÓÃbig endianÅÅÐò·½Ê½¡£
ΪÁ˽øÐÐת»» bsd socketÌṩÁËת»»µÄº¯Êý ÓÐÏÂÃæËĸö
htons °Ñunsigned shortÀàÐÍ´ÓÖ÷»úÐòת»»µ½ÍøÂçÐò
htonl °Ñunsigned longÀàÐÍ´ÓÖ÷»úÐòת»»µ½ÍøÂçÐò
ntohs °Ñunsigned shortÀàÐÍ´ÓÍøÂçÐòת»»µ½Ö÷»úÐò
ntohl °Ñunsigned longÀàÐÍ´ÓÍøÂçÐòת»»µ½Ö÷»úÐò
ÔÚʹÓÃlittle endianµÄϵͳÖÐ ÕâЩº¯Êý»á°Ñ×Ö½ÚÐò½øÐÐת»»
ÔÚʹÓÃbig endianÀàÐ͵ÄϵͳÖÐ ÕâЩº¯Êý»á¶¨Òå³É¿Õºê
ͬÑù ÔÚÍøÂç³ÌÐò¿ª·¢Ê± »òÊÇ¿çƽÌ


Ïà¹ØÎĵµ£º

Groovy javaµÄºÃ»ï°é4

ºÜ¿ÉÄܽ« Groovy µ±³ÉÊÇûÓйæÔòµÄ Java ´úÂë¡£µ«Êµ¼ÊÉÏ£¬Groovy Ö»ÊǹæÔòÉÙһЩ¡£ÕâÒ»½ÚµÄÖصãÊÇʹÓà Groovy ±àд Java Ó¦ÓóÌÐòʱ¿ÉÒÔ²»Óÿ¼ÂǵÄÒ»¸ö Java ±à³ÌµÄ¾ßÌå·½Ã棺ÀàÐͶ¨Òå¡£
ΪʲôҪÓÐÀàÐͶ¨Ò壿
ÔÚ Java ÖУ¬Èç¹ûÒªÉùÃ÷Ò»¸ö String ±äÁ¿£¬Ôò±ØÐëÊäÈ룺
String value = "Hello World";
µ«ÊÇ£¬Èç¹û×ÐϸÏëÏ ......

Groovy javaµÄºÃ»ï°é5

ͨ¹ý Groovy ½øÐÐÑ­»·
ͬ´ó¶àÊý½Å±¾ÓïÑÔÒ»Ñù£¬Groovy ¾­³£±»Ðû´«ÎªÉú²úÁ¦¸ü¸ß µÄ Java ÓïÑÔÌæ´úÆ·¡£ÄúÒѾ­¿´µ½ÁË Groovy ȱÉÙÀàÐÍÄܹ»ÈçºÎ¼õÉÙ´ò×Ö¹¤×÷¡£ÔÚÕâÒ»½Ú£¬½«´´½¨²¢ÊÔÓÃÒ»¸ö repeat º¯Êý¡£ÔÚÕâ¸ö¹ý³ÌÖУ¬½«½øÒ»²½Ì½Ë÷ Groovy Ìá¸ßЧÂʵķ½Ê½¡£
¸üºÃ¡¢¸ü¶ÌµÄÑ­»·
ÏÂÃæÕâÖÖ·½·¨¿ÉÒÔ¸üºÃµØ¸ÐÊÜ Groovy ȱ·¦ÀàÐ͵ĺà ......

java °²È«·½Ãæ

¼Ç¼һÏÂ
Java ACC
Java ACC¹æ·¶¶¨ÒåÁËÊÚȨ²ßÂÔÄ£¿éºÍJ2EEÈÝÆ÷Ö®¼äµÄʵÏֹ淶£¬ÕâÑùÈÝÆ÷°²È«ÌṩÕ߾ͿÉÒÔ¸ù¾Ý²Ù×÷»·¾³µÄÒªÇóÌṩJ2EEÈÝÆ÷µÄÊÚȨ¹¦ÄÜ¡£
Java ACC¹æ·¶·ÖΪÈý¸ö²¿·Ö£¬·Ö±ðÊÇ£ºÌṩ×ÅÅäÖù淶£¬°²È«²ßÂÔÅäÖù淶£¬²ßÂÔÅжϺÍÖ´Ðй淶¡£ÕâÈý¸ö²¿·Ö×éºÏÔÚÒ»Æð¹²Í¬ÃèÊöÁËÊÚȨÌṩÕߵݲװºÍÅäÖã¬J2EEÈÝÆ÷ʹÓÃÕß ......

HeritrixÍøÂçÅÀ³æ¶ÔBDBǶÈëʽÊý¾Ý¿âµÄÓ¦Óã¨JAVA£©

HeritrixÍøÂçÅÀ³æ¶ÔBDBǶÈëʽÊý¾Ý¿âµÄÓ¦Óã¨JAVA£©
Ò»¡¢HeritrixÖкÍBDBÏà¹ØµÄÀà
org.archive.bdb.BdbModule ÓÃÀ´Ó³ÉäÒ»¸ö¹²ÏíµÄBDBÊý¾Ý¿â»·¾³£¨JE£©µÄͨÓÃÄ£ÐÍ¡£
org.archive.bdb.BdbModule.BdbConfig Êý¾Ý¿âÅäÖöÔÏó¡£±ØÐèµÄ£¬ÒòΪcom.sleepycat.je.DatabaseConfigÕâ¸ö¶ÔÏóÊDz»»á±»ÐòÁл¯µÄ¡£´ËÍâËü»¹¿ÉÒÔ·ÀÖ¹ÎÞЧÉèÖà ......

EclipseÏÂjavaµÄ3´óGUI¿ª·¢²å¼þ¼°ÌØÉ«

Eclipse²¢²»×Ô´øGUIµÄ¿ÉÊÓ»¯¿ª·¢¹¤¾ß£¬ÄÇôÈç¹ûÒªÔÚEclipse½øÐпÉÊÓ»¯µÄGUI¿ª·¢£¬¾ÍÐèÒªÒÀ¿¿µÚÈý·½µÄ²å¼þ¡£
 1. Visual Editor
    Eclipse¹Ù·½ÌṩÁËÒ»¸ö½Ð×öVisual Editor(VE)µÄ¿ªÔ´GUI²å¼þ£¬¹¦ÄÜ»¹ÊDZȽÏÇ¿¡£¿ÉÒÔ¸ù¾ÝÓû§µÄ½çÃæGUIÉè¼Æ£¬×Ô¶¯Éú³ÉÏàÓ¦µÄJAVA´úÂ롣ͬÑùÒ²¿ÉÒÔͨ¹ýÏàÓ¦µÄJAVA´úÂë£¬É ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ