<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-348  評論-598  文章-0  trackbacks-0
    無符號數都可以用BigInteger來完成表現,他自身附帶了很多計算方法,可以有效地完成無符號數的計算工作。
    /**
         * 逆轉字節數組
         * 
         * 
    @param b
         * 
    @return
         
    */
        
    private static byte[] reverse(byte[] b) {

            
    byte[] temp = new byte[b.length];
            
    for (int i = 0; i < b.length; i++) {
                temp[i] 
    = b[b.length - 1 - i];
            }
            
    return temp;
        }

        
    /**
         * 讀取無符號位的Short數,16位
         * 
         * 
    @param readBuffer
         * 
    @return
         * 
    @throws IOException
         
    */
        
    private static final BigInteger readUnsignedShort(byte[] readBuffer)
                
    throws IOException {
            
    if (readBuffer == null || readBuffer.length < 2)
                
    return new BigInteger("0");
            
    // 處理成無符號數
            byte[] uint64 = new byte[3];
            uint64[
    2= 0;
            System.arraycopy(readBuffer, 
    0, uint64, 02);
            
    return new BigInteger(reverse(uint64));
        }

        
    /**
         * 讀取無符號位的長整數,64位
         * 
         * 
    @param readBuffer
         * 
    @return
         * 
    @throws IOException
         
    */
        
    private static final BigInteger readUnsignedInt64(byte[] readBuffer)
                
    throws IOException {
            
    if (readBuffer == null || readBuffer.length < 8)
                
    return new BigInteger("0");
            
    // 處理成無符號數
            byte[] uint64 = new byte[9];
            uint64[
    8= 0;
            System.arraycopy(readBuffer, 
    0, uint64, 08);
            
    return new BigInteger(reverse(uint64));
        }


    ---------------------------------------------------------
    專注移動開發

    Android, Windows Mobile, iPhone, J2ME, BlackBerry, Symbian
    posted on 2010-05-03 09:18 TiGERTiAN 閱讀(9122) 評論(0)  編輯  收藏 所屬分類: Java
    主站蜘蛛池模板: 亚洲女人初试黑人巨高清| 午夜时刻免费入口| 在线观看国产区亚洲一区成人 | 中国人xxxxx69免费视频| 中国亚洲女人69内射少妇| 精品国产免费一区二区三区| 亚洲国产综合精品中文字幕| 特级做a爰片毛片免费看| 亚洲国产精品人人做人人爱| 久久WWW免费人成—看片| 亚洲精品无码MV在线观看| 国产午夜精品免费一区二区三区 | 亚洲人妖女同在线播放| 中文字幕无码不卡免费视频| 国产亚洲精品成人AA片| 成人爱做日本视频免费| 免费播放美女一级毛片| 国产亚洲精品不卡在线| 99热精品在线免费观看| 亚洲中文无码mv| 亚洲成a人片在线播放| 光棍天堂免费手机观看在线观看| 久久久久亚洲AV无码专区首| 和日本免费不卡在线v| 中文有码亚洲制服av片| 亚洲欧洲自拍拍偷精品 美利坚| aa毛片免费全部播放完整| 亚洲韩国在线一卡二卡| 手机看片久久国产免费| 国产精品美女免费视频观看| 亚洲精品美女久久久久9999| 成人永久福利免费观看| a级毛片在线视频免费观看| 亚洲免费人成视频观看| 亚洲精品国产电影| 最近在线2018视频免费观看| 久久亚洲欧美国产精品| 亚洲av日韩av高潮潮喷无码| 免费看a级黄色片| 在线观看片免费人成视频无码| 亚洲伊人久久大香线蕉AV|