Search code examples
javareflectionassemblybytecodejava-bytecode-asm

Java: new instance from bytecode


ClassWriter cw = new ClassWriter(...);
byte[] bytes = cw.toByteArray();

I would like to create new class instance from bytes array. How do I do this? Is it possible at all?


Solution

  • ClassLoader.defineClass()
    

    Reference: