[JAVA]intÀàÐͺÍbyte[]»¥×ª
package com.mapabc.sz_hbt.util;
/**
* <p>Title:ÕûÐÍÓ볤¶ÈΪ4µÄ×Ö½ÚÊý×éµÄ»¥»» </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2007-5-10</p>
* <p>Company: www.mapabc.com</p>
* @author luoyj
* @version 1.0
*/
public class ByteUtil {
/**
* ÕûÐÍת»»Îª4λ×Ö½ÚÊý×é
* @param intValue
* @return
*/
public static byte[] int2Byte(int intValue) {
byte[] b = new byte[4];
for (int i = 0; i < 4; i++) {
b[i] = (byte) (intValue >> 8 * (3 - i) & 0xFF);
//System.out.print(Integer.toBinaryString(b[i])+" ");
//System.out.print((b[i] & 0xFF) + " ");
}
return b;
}
/**
* 4λ×Ö½ÚÊý×éת»»ÎªÕûÐÍ
* @param b
* @return
*/
public static int byte2Int(byte[] b) {
int intValue = 0;
// int tempValue = 0xFF;
for (int i = 0; i < b.length; i++) {
intValue += (b[i] & 0xFF) << (8 * (3 - i));
// System.out.print(Integer.toBinaryString(intValue)+" ");
}
return intValue;
}
}
Ïà¹ØÎĵµ£º
̸̸Java¼Ì³ÐÖеÄÖØÔØ£¬¸²¸ÇºÍÒþ²Ø
ºÃ¾Ã²»Ð´²©¿ÍÁË£¬¾àÀëÉÏһƪÒѾ¹ýÁËÁ½Äê¶àÁË¡£ÕâÁ½ÄêÔÚ¸ÉÂï,×ÜÖ®Ò»ÄêÄѾ¡£¡
ǰһ¶Îʱ¼äæÁËÁ½¸öÔ£¬Ã¦×ÅÑо¿ºÍ×öһЩSSH¼Ü¹¹µÄ¶«Î÷£¬Á½¸öÔÂÏÂÀ´£¬ÊÕ»ñÆÄ·á£¬×î½üÏÐÏÂÀ´ÁË£¬ÓÚÊǾÍÍ´¿ìµÄ¿ªÊ¼ÍæÓÎÏ·£¬µ«ÊDz»ÖªÔõôµØ£¬ÔõÃ´Íæ¶¼Ã»Òâ˼£¬ÓÚÊǾö¶¨¿ªÊ¼ÔٺúÃÑо¿Ñо¿Java°É¡£ÓÚÊÇ´ó¸Å·ÁË· ......
ÒòΪ³ÌÐòÒª´ÓÊý¾Ý¶ÁÈ¡½ü10WÐмǼ´¦Àí£¬µ±¶Áµ½9WµÄʱºò¾Í³öÏÖ java.lang.OutOfMemoryError: Java heap space ÕâÑùµÄ´íÎó¡£
ÔÚÍøÉÏÒ»²é¿ÉÄÜÊÇJAVAµÄ¶ÑÕ»ÉèÖÃ̫СµÄÔÒò¡£
¸ú¾ÝÍøÉϵĴ𰸴óÖÂÓÐÕâÁ½ÖÖ½â¾ö·½·¨£º
1¡¢ÉèÖû·¾³±äÁ¿
set JAVA_OPTS= -Xms32m -Xmx512m
¿ÉÒÔ¸ù¾Ý×Ô¼º»úÆ÷µÄÄÚ´æ½øÐиü¸Ä,µ«±¾È˲âÊÔÕâÖÖ· ......
1 mysql´æ´¢´óÈÝÁ¿µÄ¶þ½øÖÆÎļþµÄ¸ñʽÊÇblob£¬Æäʵ³ýÁËͼƬ»¹¿ÉÒÔ´æ±ðµÄ
2 ÒªÏòÊý¾Ý¿â´æ´¢¶þ½øÖƵÄÎļþÒ»¶¨Òª°ÑÒª´æ´¢µÄÊý¾Ýת»»³É¶þ½øÖÆÁ÷
·Ï»°¾Í²»¶à˵ÁË£¬´ó¼Ò¿´¿´´úÂëºÜÈÝÒ×Ã÷°×£¬ÏÈÀ´¿´Ò»¸öapp³ÌÐò£¬µ±È»Ê×ÏÈÄúÒªÔÚÊý¾Ý¿âÖÐÏȽ¨Á¢Ò»¸öÓÃÓÚ±£´æÍ¼Æ¬µÄ±íºÍÏàÓ¦µÄÁУ¬Êý¾Ý¸ñʽΪblob
package ......
By ³å³öÓîÖæ from °Á¶û¿Æ¼¼(www.hour41.com)
ʱ¼ä£º2006-11-17
×¢£º×ªÔØÇë×¢Ã÷×÷Õߺ͵¥Î»¡£
JavaÓïÑÔ±ê×¼´Ó1996Äê·¢²¼µÚÒ»°æ£¬µ½2000Äê·¢²¼µÚ¶þ°æ£¬ÔÙµ½2004Äê·¢²¼µÚÈý°æ£¬javaÓïÑÔÒѾ¾¹ýÁË3´Î´óµÄÀ©³äºÍ¸Ä½ø¡£¹¦ÄÜÊÇÔ½À´Ô½¶à£¬²Ù×÷ÊÇÔ½À´Ô½¸´ÔÓ¡£ÏÔÈ»£¬ÐÔÄÜÎÊÌâÒ²¾ÍÔ½À´Ô½Í» ......
¸÷ÖÖJavaÖÐÎÄתÂëµÄÀý×Ó£¬ÓÃÀ´¶Ô¸¶ÂÒÂë
public class HelloWorld
{
public static void main(String[] argv){
try{
System.out.println("ÖÐÎÄ1"); //1
System.out.p ......