DJ_AM_Juicebox
asked on
Serialization of base type
Hi,
Is it possible to do something like:
class Parent implements Serializable {
}
class Child extends Parent {
}
void Serialize()
{
Child c = new Child();
byte[] b = c.serializeToByteArray();
Deserialize(b);
}
void Deserialize(byte[] b)
{
Parent p = (Parent)b.deserialize();
}
Just wondering...
Thanks
Is it possible to do something like:
class Parent implements Serializable {
}
class Child extends Parent {
}
void Serialize()
{
Child c = new Child();
byte[] b = c.serializeToByteArray();
Deserialize(b);
}
void Deserialize(byte[] b)
{
Parent p = (Parent)b.deserialize();
}
Just wondering...
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You wont to clone the Child class.
If it is that, you can serialize the Child and after do the unserialize and you got the clone.