예제 #1
0
        internal static long GetInt(byte[] aBytes)
        {
            long num = 0L;

            switch (aBytes.Length)
            {
            case 1:
            {
                int num2 = (int)(aBytes[0] & 255);
                return((long)num2);
            }

            case 2:
                return((long)Byte2SecsValue.GetI2(aBytes)[0]);

            case 3:
                return(num);

            case 4:
                return((long)Byte2SecsValue.GetI4(aBytes)[0]);

            case 5:
            case 6:
            case 7:
                return(num);

            case 8:
                return(Byte2SecsValue.GetI8(aBytes)[0]);

            default:
                return(num);
            }
        }
예제 #2
0
 private long[] ParseInt8(int aLength)
 {
     long[] result;
     try
     {
         byte[] aBytes = new byte[aLength];
         Array.Copy(this.mDataItem, this.mReadIndex, aBytes, 0, aBytes.Length);
         this.mReadIndex += aLength;
         result           = Byte2SecsValue.GetI8(aBytes);
     }
     catch (Exception)
     {
         result = null;
     }
     return(result);
 }