Image may be NSFW.
Clik here to view.
Clik here to view.

Many frameworks for storing objects in an off-line or cached manner, use standard Java Serialization to encode the object as bytes which can be turned back into the original object.
Java Serialization is generic and can serialise just about any type of object.