Ejemplo n.º 1
0
        private static void UnpackMap32(SAXInfo info)
        {
            UInt32 length;

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

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

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

            info.AddContainer(container);

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

            info.PopContainer();
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
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();
        }