"bammi" wrote:
Thank you for your efforts with JavaAssist: I have a quick question for you (I quickly scanned the forums and did not see a direct answer): I want to use a byte code engineering library like java assist in a pipeline. In particular, I want to hook into the pipline where a class loader hands be a byte array with the class bytes, I want to transform those bytes by javaassist and hand the modified bytes back to the class loader.9I am experimenting with BEA Jrockit which has this hook). How easy is it with java assist to do this. All the examples show its usage with files, or using the output as a byte stream. A small code example would be absolutely wonderful. If I missed some documented way to do this, I apologize, and please could you point me to such document.
Thanks again, and look forward to your reply.
bammi@memento-inc.com
"chiba" wrote:
Please use javassist.ByteArrayClassPath.
Sample code is in the javadoc (API manual).
To obtain the bytecode after the modification
with Javassist, use CtClass#toBytecode().