Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to convert in-memory Class to bytecode byte[]?

cowwoc-JavaNetDec 28 2006 — edited Sep 17 2007
Hi,

I have a class definition which does not exist on disk and I want to send this over the wire to another JVM which does not know about it ahead of time. How do I take a class definition, and dump its bytecode to byte[]?

Give a Class object I know I can serialize it to a byte[] but my understanding is that the serialized form of a Class object is not the same thing as the bytecode for a class definition. Any ideas?

Thanks,
Gili
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 15 2007
Added on Dec 28 2006
11 comments
517 views