public static ConstantMember Parse(BytecodeReader reader, BytecodeReader memberReader)
        {
            var result     = new ConstantMember();
            var nameOffset = memberReader.ReadUInt32();
            var typeOffset = memberReader.ReadUInt32();
            var nameReader = reader.CopyAtOffset((int)nameOffset);

            result.Name = nameReader.ReadString();
            var typeReader = reader.CopyAtOffset((int)typeOffset);

            result.Type = ConstantType.Parse(reader, typeReader);
            return(result);
        }
示例#2
0
        public static ConstantType Parse(BytecodeReader reader, BytecodeReader typeReader)
        {
            var result = new ConstantType();

            result.ParameterClass = (ParameterClass)typeReader.ReadUInt16();
            result.ParameterType  = (ParameterType)typeReader.ReadUInt16();
            result.Rows           = typeReader.ReadUInt16();
            result.Columns        = typeReader.ReadUInt16();
            result.Elements       = typeReader.ReadUInt16();
            var memberCount      = typeReader.ReadUInt16();
            var memberInfoOffset = typeReader.ReadUInt32();

            if (memberCount != 0)
            {
                var memberReader = reader.CopyAtOffset((int)memberInfoOffset);
                for (int i = 0; i < memberCount; i++)
                {
                    result.Members.Add(ConstantMember.Parse(reader, memberReader));
                }
            }
            return(result);
        }