Java代码工具类

1.Java byte数组转int  

public static int toInt(byte[] bRefArr) { 
         int iOutcome = 0; 
         byte bLoop; 
         for ( int i =0; i<4 ; i++) { 
             bLoop = bRefArr[i]; 
             iOutcome+= (bLoop & 0xFF) << (8 * i); 
         }   
         return iOutcome; 
 }    
posted @ 2012-10-11 11:10  吴超文  阅读(232)  评论(0编辑  收藏  举报