Details
-
Type: New Feature
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.1
-
Component/s: None
-
Labels:None
Description
XStream already provides a mechanism for having an XML backed ObjectInputStream/ObjectOutputStream (necessary for implementing Serializable/Externalizable support).
A simple method should be added to the XStream facade making it easy to create one of these - allowing XStream to be used in many places as a drop in replacement to standard Java serialization.
So, instead of:
ObjectOutputStream oos = new ObjectOutputStream(out);
oos.writeObject(myObject);
You could do:
ObjectOutputStream oos = xstream.createObjectOutputStream(out, "root-element");
oos.writeObject(myObject);