Serializes an {@link InvalidTargetObjectTypeException} to an {@link ObjectOutputStream}.
if (compat)
{
// Serializes this instance in the old serial form
//
ObjectOutputStream.PutField fields = out.putFields();
fields.put("relatedExcept", exception);
fields.put("msgStr", ((exception != null)?exception.getMessage():""));
out.writeFields();
}
else
{
// Serializes this instance in the new serial form
//
out.defaultWriteObject();
}