Java.io.ObjectInputStream enableResolveObject() Method



Description

The java.io.ObjectInputStream.enableResolveObject(boolean enable) method enable the stream to allow objects read from the stream to be replaced. When enabled, the resolveObject method is called for every object being deserialized.

If enable is true, and there is a security manager installed, this method first calls the security manager's checkPermission method with the SerializablePermission("enableSubstitution") permission to ensure it's ok to enable the stream to allow objects read from the stream to be replaced.

Declaration

Following is the declaration for java.io.ObjectInputStream.enableResolveObject() method.

protected boolean enableResolveObject(boolean enable)

Parameters

enabletrue for enabling use of resolveObject for every object being deserialized

Return Value

This method returns the previous setting before this method was invoked.

Exception

SecurityException − If a security manager exists and its checkPermission method denies enabling the stream to allow objects read from the stream to be replaced.

java_io_objectinputstream.htm
Advertisements