If these objects are immutable, it is OK to store them somewhere, and serialize a placeholder instead. Then, replace the placeholder with the stored object upon de-serialization.
This will relax a the requirement for heap/stack objects to be serializable.
If these objects are immutable, it is OK to store them somewhere, and serialize a placeholder instead. Then, replace the placeholder with the stored object upon de-serialization.
This will relax a the requirement for heap/stack objects to be serializable.