Deep cloning of Serializable objects

The following code snippet shows how to use Object I/O streams to deep clone Serializable objects. The object bytes once written on an ObjectOutputStream can be read back to a new object with all the populated values intact. The only catch is that, because the object is written and then read from a stream, this process is slower then the normal getter-setter approach.