Re: Re: Instrument a class and get new instance of it
"Torsten Curdt" <[email protected]> Fri, 14 Jul 2006 09:06:31 +0200
| Newsgroups | gmane.comp.jakarta.bcel.user |
|---|---|
| Message-ID | <[email protected]> |
> You can turn an array of bytes into a Class using the method > ClassLoader.defineClass. This method is protected, but you can call it > by using reflection (locate the Method object for it, then call > Method.invoke). Yes it's rather ugly but it works. Well, or have your own classloader http://jakarta.apache.org/commons/sandbox/javaflow/xref/org/apache/commons/javaflow/bytecode/BytecodeClassLoader.html cheers -- Torsten