By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,034 Members | 820 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,034 IT Pros & Developers. It's quick & easy.

creating a .class file

P: n/a
If I have a Class object, serialized or somehow stored, is there any way I
can use it to create a .class file?
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
No: look at Class.java source. Even if Class object is serializable, it is
not really serialized:

/**
* Class Class is special cased within the Serialization Stream
Protocol.
*
* A Class instance is written intially into an ObjectOutputStream in
the
* following format:
* <pre>
* <code>TC_CLASS</code> ClassDescriptor
* A ClassDescriptor is a special cased serialization of
* a <code>java.io.ObjectStreamClass</code> instance.
* </pre>
* A new handle is generated for the initial time the class descriptor
* is written into the stream. Future references to the class descriptor
* are written as references to the initial class descriptor instance.
*
* @see java.io.ObjectStreamClass
*/
private static final ObjectStreamField[] serialPersistentFields =
ObjectStreamClass.NO_FIELDS;

You still need the .class file.

regards,
~Luigi

+#if defined(__alpha__) && defined(CONFIG_PCI)
+ /*
+ * The meaning of life, the universe, and everything. Plus
+ * this makes the year come out right.
+ */
+ year -= 42;
+#endif
(From the patch for 1.3.2: (kernel/time.c), submitted by Marcus Meissner)

"andthen" <a@n.d> ha scritto nel messaggio
news:cV********************@news4.srv.hcvlny.cv.ne t...
If I have a Class object, serialized or somehow stored, is there any way I
can use it to create a .class file?

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.