It looks like EnumSet.SerializationProxy is the class that is
serialized instead of EnumSet, since it overrides readResolve method
and contains the information, essential for re-creation of EnumSet.
Probably, the scheme looks like this:
1) EnumSet overrides writeReplace which returns appropriate
EnumSet.SerializationProxy object, which is serialized.
2) When EnumSet.SerializationProxy is deserialized, readResolve method
is called to replace deserialized instance of
EnumSet.SerializationProxy with appropriate EnumSet object. This
method constructs EnumSet object with one of its factory methods
(noneOf suits for this, probably) and initializes it properly.

See API specification for Serializable interface for the description
of readResolve/writeReplace.

I am not an expert in serialization, so I am not sure if we need to
copy this behavior to be compatible with RI or it is possible just to
use SerialVersionUID and serialized form of EnumSet.SerializationProxy
for our EnumSet.

On 8/14/06, Spark Shen <[EMAIL PROTECTED]> wrote:
Hi All:
After reading the serialized form of EnumSet, I found an inner class

java.util.EnumSet.SerializationProxy.

This class does not have any extra explaination. Does any one has any
suggestion on how to deal with it?

Best regards

--
Spark Shen
China Software Development Lab, IBM


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to