Both object streams and objects themselves have the ability to nominate replacement objects at serialization time. This object replacement feature has many uses. If your object graph contains an object that is not serializable, you can replace it with an object that is serializable. If you are doing distributed programming, you can replace an object's state with an object's stub, causing the receiver to get a reference to the remote object, instead of a local by-value copy of the object. RMI uses object replacement for this purpose. Replacement may also be useful if you want to add additional semantics to serialization that go beyond the capabilities of the readObject and writeObject methods.