Пример #1
0
        private AttributeBase LoadInnerClasses(BigEndianBinaryReader reader, int attributeLength)
        {
            int numberOfClasses = reader.ReadUInt16();

            var innerClasses = new InnerClass[numberOfClasses];

            for (int i = 0; i < numberOfClasses; i++)
            {
                string innerClassName  = constantPool.GetItem <ClassConstantPoolItem>(reader.ReadUInt16()).Name;
                string outerClassName  = null;
                int    outerClassIndex = reader.ReadUInt16();
                if (outerClassIndex > 0)
                {
                    outerClassName = constantPool.GetItem <ClassConstantPoolItem>(outerClassIndex).Name;
                }
                string name      = null;
                int    nameIndex = reader.ReadUInt16();
                if (nameIndex > 0)
                {
                    name = constantPool.GetItem <Utf8ConstantPoolItem>(nameIndex).String;
                }

                InnerClassAccessFlags flags = (InnerClassAccessFlags)reader.ReadUInt16();

                innerClasses[i] = new InnerClass(innerClassName, outerClassName, name, flags);
            }

            return(new InnerClassesAttribute(innerClasses));
        }
Пример #2
0
 public InnerClass(string innerClassName, string outerClassName, string name, InnerClassAccessFlags accessFlags)
 {
     this.InnerClassName = innerClassName;
     this.OuterClassName = outerClassName;
     this.Name           = name;
     this.AccessFlags    = accessFlags;
 }