Get bytecode at runtime

I am wondering if I can get the bytecode of a java class at runtime? This would include the bytecode of any class loaded through the classloaders and/or created with defineClass. It seems funny that I can define a class with a bytestream but I can't get the code from one!!! Thanks for your help.

-java

PS... I have heard that java.lang.instrumentation can be used for this but that a command line paramater is needed. Is there a way around this? Thanks.

[474 byte] By [markjavadluxa] at [2007-10-3 3:30:41]
# 1
You can, using ClassLoader.getResourceAsStream. E.g. Foo.class.getClassLoader().getResourceAsStream("my/pckge/Foo.class");
YAT_Archivista at 2007-7-14 21:24:36 > top of Java-index,Core,Core APIs...