Package net.bytebuddy.dynamic.loading
Interface ClassInjector.UsingJna.Dispatcher.Jvm
-
- All Superinterfaces:
com.sun.jna.Library
- Enclosing interface:
- ClassInjector.UsingJna.Dispatcher
public static interface ClassInjector.UsingJna.Dispatcher.Jvm extends com.sun.jna.Library
A JNA dispatcher for the JVM's JVM_DefineClass method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Class<?>
JVM_DefineClass(com.sun.jna.JNIEnv env, java.lang.String name, java.lang.ClassLoader classLoader, byte[] binaryRepresentation, int length, java.security.ProtectionDomain protectionDomain)
Defines a new class into a given class loader.
-
-
-
Method Detail
-
JVM_DefineClass
java.lang.Class<?> JVM_DefineClass(com.sun.jna.JNIEnv env, java.lang.String name, java.lang.ClassLoader classLoader, byte[] binaryRepresentation, int length, java.security.ProtectionDomain protectionDomain) throws com.sun.jna.LastErrorException
Defines a new class into a given class loader.- Parameters:
env
- The JNI environment.name
- The internal name of the class.classLoader
- The class loader to inject into ornull
if injecting into the bootstrap loader.binaryRepresentation
- The class's binary representation.length
- The length of the class's binary representation.protectionDomain
- The protection domain ornull
if no explicit protection domain should be used.- Returns:
- The class that was defined.
- Throws:
com.sun.jna.LastErrorException
- If an error occurs during injection.
-
-