I found this method (i modified it slightly) on the mailing list archive. Is there
any built-in support in SourceGenerator or do I have to use this:
public static Object clone(Object obj) throws java.io.IOException,
java.lang.ClassNotFoundException
{
Object clonedObj = null;
ByteArrayOutputStream baos = null;
ObjectOutputStream oos = null;
ByteArrayInputStream bais = null;
ObjectInputStream ois = null;
//serialize
baos = new ByteArrayOutputStream();
oos = new ObjectOutputStream(baos);
oos.writeObject(obj);
oos.flush();
//deserialize
bais = new ByteArrayInputStream(baos.toByteArray());
ois = new ObjectInputStream(bais);
clonedObj = ois.readObject();
return clonedObj;
}
> I know that this question has been asked before but I didn't see an answer. I
> need to make a deep copy of a Castor object graph/tree. What's the easiest way
> to do this???
>
> Thanks,
> Robert
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev