Class DefineClassHelper


  • public final class DefineClassHelper
    extends java.lang.Object
    Java 11+ removed sun.misc.Unsafe.defineClass. This class bridges the gap to work from Java 1.8 up to 11.

    It was inspired from javassist.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Class<?> defineClass​(java.lang.String name, byte[] b, int off, int len, java.lang.Class<?> neighbor, java.lang.ClassLoader loader, java.security.ProtectionDomain protectionDomain)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • defineClass

        public static java.lang.Class<?> defineClass​(java.lang.String name,
                                                     byte[] b,
                                                     int off,
                                                     int len,
                                                     java.lang.Class<?> neighbor,
                                                     java.lang.ClassLoader loader,
                                                     java.security.ProtectionDomain protectionDomain)