Serialize a java.awt.geom.Area
问题 I have the need to serialize an Area object (java.awt.geom.Area) in a socket. However it doesn't seem to be serializable. Is there a way to do such thing? Maybe by converting it into a different object? Thanks in advance 回答1: I found this workaround: AffineTransform.getTranslateInstance(0,0).createTransformedShape(myArea) This results in a shape that can be serialized. 回答2: Use XStream to trivially convert it to/from XML. You don't need your object to implement particular interfaces, and the