Example #1
0
        private static void UnpackArray16(SAXInfo info)
        {
            ushort length;

            if (BitConverter.IsLittleEndian)
            {
                byte[] lengthBuffer = new byte[2];
                Array.Copy(info.binary, info.currIdx, lengthBuffer, 0, 2);
                Array.Reverse(lengthBuffer);

                length = BitConverter.ToUInt16(lengthBuffer, 0);
            }
            else
            {
                length = BitConverter.ToUInt16(info.binary, info.currIdx);
            }
            info.currIdx += 2;

            ContainerInfo container = new ContainerInfo(false, (int)length);

            info.AddContainer(container);

            for (ushort i = 0; i < length; i++)
            {
                UnpackNext(info);
            }

            info.PopContainer();
        }
Example #2
0
        private static void UnpackFixArray(SAXInfo info)
        {
            byte length = info.binary[info.currIdx - 1];

            length &= 0x0F;

            ContainerInfo container = new ContainerInfo(false, (int)length);

            info.AddContainer(container);

            for (byte i = 0; i < length; i++)
            {
                UnpackNext(info);
            }

            info.PopContainer();
        }
Example #3
0
        private static void UnpackFixMap(SAXInfo info)
        {
            byte length = info.binary[info.currIdx - 1];

            length &= 0x0F;

            ContainerInfo container = new ContainerInfo(true, (int)length);

            info.AddContainer(container);

            for (ushort i = 0; i < length * 2; i++)
            {
                UnpackNext(info);
            }

            info.PopContainer();
        }