From cf1d22fa1f2554df07801291b98f84c627fc9ef5 Mon Sep 17 00:00:00 2001 From: chibash Date: Mon, 2 Sep 2019 00:21:32 +0900 Subject: adds ClassFileWriter#addDynamicInfo --- src/main/javassist/bytecode/ClassFileWriter.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/main/javassist/bytecode') diff --git a/src/main/javassist/bytecode/ClassFileWriter.java b/src/main/javassist/bytecode/ClassFileWriter.java index 931ffcb4..90b56086 100644 --- a/src/main/javassist/bytecode/ClassFileWriter.java +++ b/src/main/javassist/bytecode/ClassFileWriter.java @@ -700,6 +700,24 @@ public class ClassFileWriter { return num++; } + /** + * Adds a new CONSTANT_Dynamic_info + * structure. + * + * @param bootstrap bootstrap_method_attr_index. + * @param nameAndTypeInfo name_and_type_index. + * @return the index of the added entry. + * + * @since 3.26 + */ + public int addDynamicInfo(int bootstrap, + int nameAndTypeInfo) { + output.write(DynamicInfo.tag); + output.writeShort(bootstrap); + output.writeShort(nameAndTypeInfo); + return num++; + } + /** * Adds a new CONSTANT_String_info * structure. -- cgit v1.2.3