On Mar 31, 2005 6:12 PM, Howard Lewis Ship <hl...@gm...> wrote:
> I make use of Javassist to create classes in-memory. I was thinking
> it would be useful and informative to plug JODE into my pipeline, so
> that I could de-compile the dynamically generated bytecode.
>
> Couldn't see how to do this with JODE. It seems organized around the
> bytecodes sitting in a file. Is there a way to easily support
> decompling a Class object already in memory? Alternately, I can get
> the generated bytecode (into a byte[] array) and would like to
> decompile that.
With the latest CVS version or 1.90-pre releases you can write your own
classpath location, which can load classes from any virtual location.
As an example, see ZipLocation, which loads classes from an in memory
zip file. All you need is to override the getFile() method to return an
ByteArrayInputStream(). Then you can create a new ClassPath with your
location and decompile classes from this classpath.
Regards,
Jochen
--
Jochen Hoenicke, University of Oldenburg, 26111 Oldenburg, Germany
Email: hoe...@in... Tel: +49 441 798 3124
|