Fork of the Fernflower decompiler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fernflower/src/org/jetbrains/java/decompiler/struct/attr/StructCodeAttribute.java

43 lines
1.3 KiB

// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.java.decompiler.struct.attr;
import org.jetbrains.java.decompiler.struct.StructMember;
import org.jetbrains.java.decompiler.struct.consts.ConstantPool;
import org.jetbrains.java.decompiler.util.DataInputFullStream;
import java.io.IOException;
import java.util.Map;
/*
u2 max_stack;
u2 max_locals;
u4 code_length;
u1 code[];
u2 exception_table_length;
exception_table[] {
u2 start_pc;
u2 end_pc;
u2 handler_pc;
u2 catch_type;
};
u2 attributes_count;
attribute_info attributes[];
*/
public class StructCodeAttribute extends StructGeneralAttribute {
public int localVariables = 0;
public int codeLength = 0;
public int codeFullLength = 0;
public Map<String, StructGeneralAttribute> codeAttributes;
@Override
public void initContent(DataInputFullStream data, ConstantPool pool) throws IOException {
data.discard(2);
localVariables = data.readUnsignedShort();
codeLength = data.readInt();
data.discard(codeLength);
int excLength = data.readUnsignedShort();
data.discard(excLength * 8);
codeFullLength = codeLength + excLength * 8 + 2;
codeAttributes = StructMember.readAttributes(data, pool);
}
}