The following code example shows how to make a serialization surrogate class that knows how to properly serialize or deserialize a class that is not itself serializable. In addition, this example also shows how to recover from a SerializationException.