コード例 #1
0
 private void FromHexString(byte[] bs, int p)
 {
     try
     {
         w1 = RawParseUtils.ParseHexInt32(bs, p);
         w2 = RawParseUtils.ParseHexInt32(bs, p + 8);
         w3 = RawParseUtils.ParseHexInt32(bs, p + 16);
         w4 = RawParseUtils.ParseHexInt32(bs, p + 24);
         w5 = RawParseUtils.ParseHexInt32(bs, p + 32);
     }
     catch (IndexOutOfRangeException)
     {
         throw new InvalidObjectIdException(bs, p, Constants.OBJECT_ID_STRING_LENGTH);
     }
 }
コード例 #2
0
ファイル: ObjectId.cs プロジェクト: TetradogOther/NGit
 private static NGit.ObjectId FromHexString(byte[] bs, int p)
 {
     try
     {
         int a = RawParseUtils.ParseHexInt32(bs, p);
         int b = RawParseUtils.ParseHexInt32(bs, p + 8);
         int c = RawParseUtils.ParseHexInt32(bs, p + 16);
         int d = RawParseUtils.ParseHexInt32(bs, p + 24);
         int e = RawParseUtils.ParseHexInt32(bs, p + 32);
         return(new NGit.ObjectId(a, b, c, d, e));
     }
     catch (IndexOutOfRangeException)
     {
         throw new InvalidObjectIdException(bs, p, Constants.OBJECT_ID_STRING_LENGTH);
     }
 }
コード例 #3
0
        private static int HexUInt32(byte[] bs, int p, int end)
        {
            if (8 <= end - p)
            {
                return(RawParseUtils.ParseHexInt32(bs, p));
            }
            int r = 0;
            int n = 0;

            while (n < 8 && p < end)
            {
                r <<= 4;
                r  |= RawParseUtils.ParseHexInt4(bs[p++]);
                n++;
            }
            return(r << (8 - n) * 4);
        }