I have got an object which contains non serializable object inside.
class object BigObject<T extends smallObject> implements Serializable{
private T insideObject;
public BigObject(T insideObject) {this.insideObject = insideObject;}
}
I would like to serializable Big object, but I get java.io.NotSerializableException error for obvious reasons. I read topics like:Java Serialization with non serializable parts or https://dzone.com/articles/serializing-java-objects-non The answers were very interesting, but could not resovle my problem. First of all insideObject is a class from a library, co I cannot add serializable implementation. The answer given on the dzone webpage is also interesting (to write your own writeObject methods). But as you can see, insideObject is a generic class, we can get a few types of insideObject extending on smallObject in bigObject, so this solution is impossible.
So, is it possible to manage with this problem in the other way? Maybe I can somehow add implementation of serializable on the existing object? Or only external liblaries as Kyro can help me with my problem?