예제 #1
0
        public static QCode GetQCodeFromOpCode(byte opCode)
        {
            QCode q = _qCodesOrdered[opCode];

            if (q == null)
            {
                q = new QCode(opCode, "!! INVALID QCODE !!");
            }

            return(q);
        }
예제 #2
0
        private static void BuildTables(QCode[] unordered)
        {
            _qCodesOrdered = new QCode[256];

            for (int i = 0; i < unordered.Length; i++)
            {
                int index = unordered[i].Code;

                if (_qCodesOrdered[index] != null)
                {
                    throw new InvalidOperationException(String.Format("Duplicate QCode entry {0}", index));
                }

                _qCodesOrdered[index] = unordered[i];
            }
        }