/// <summary> /// Creates and reads the exception table /// </summary> /// <param name="reader"></param> /// <param name="javaClass"></param> /// <returns></returns> public static JavaExceptionTable CreateAndRead(BinaryReader reader, JavaClass javaClass) { var exceptionTable = new JavaExceptionTable(); exceptionTable.Read(reader, javaClass); return(exceptionTable); }
/// <summary> /// Reads the attribute info /// </summary> /// <param name="reader"></param> /// <param name="javaClass"></param> public override void Read(BinaryReader reader, JavaClass javaClass) { MaxStack = reader.ReadUInt16(); MaxLocals = reader.ReadUInt16(); // Reads the code var len = reader.ReadUInt32(); Code = reader.ReadBytes((int)len); // Reads the exception var exceptions = reader.ReadUInt16(); Exceptions = new JavaExceptionTable[exceptions]; for (int i = 0; i < exceptions; i++) { Exceptions[i] = JavaExceptionTable.CreateAndRead(reader, javaClass); } // Reads the attributes var attributes = reader.ReadUInt16(); Attributes = new JavaAttributeInfo[attributes]; for (int i = 0; i < attributes; i++) { Attributes[i] = JavaAttributeInfo.CreateAndRead(reader, javaClass); } }