예제 #1
0
        public override void Read()
        {
            TypeDataReader r = CreateReader();

            NumberOfEntries = r.ReadUInt16();

            //round up 4 bits (descriptor size)
            int numberOfBytes = (int)Math.Ceiling((double)(4 * NumberOfEntries) / 8);

            byte[] descriptorsData = r.ReadBytes(numberOfBytes);

            Descriptors = new VTableShapeDescriptor[NumberOfEntries];

            for (int i = 0; i < NumberOfEntries; i++)
            {
                byte data = descriptorsData[i / 2];
                switch (i % 2)
                {
                case 0:
                    data &= 0xF;
                    break;

                case 1:
                    data = (byte)((data >> 4) & 0xF);
                    break;
                }

                Descriptors[i] = (VTableShapeDescriptor)data;
            }
        }
예제 #2
0
        public override void Read()
        {
            TypeDataReader r = CreateReader();

            UInt16 length = r.ReadUInt16();

            byte[] data = r.ReadBytes((int)length);
            Value = Encoding.ASCII.GetString(data);
        }