Exemple #1
0
        // Получаем заявленную в пакете длину из полученных RAW-данных в массиве msg
        private UInt64 getLength(byte[] msg, ref int cursor)
        {
            UInt64 res = ByteManager.constructByte(msg[1], 0, 6);

            cursor = 2;
            if (res == 126)
            {
                res = ByteManager.Int16FromBytes(msg[cursor++], msg[cursor++]);
            }
            else if (res == 127)
            {
                res    = ByteManager.Int64FromBytes(msg, 2);
                cursor = 10;
            }

            return(res);
        }