Class DefineClassUtils


  • public class DefineClassUtils
    extends Object
    This utility class provides a thin runtime abstraction to pick between - sun.misc.Unsafe.defineClass in Java 8, - and MethodHandles.Lookup.defineClass in Java 9 and above, while still providing compile-time support for both Java 8 and Java 9+. See also ByteBufferUtils
    • Constructor Detail

      • DefineClassUtils

        public DefineClassUtils()
    • Method Detail

      • defineClass

        public static Class defineClass​(Class<?> targetClass,
                                        byte[] byteCode,
                                        String className)