Code example for SerializablePermission

0
 
    private static Void checkPermission() {
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            if (!allowSubclass)
                sm.checkPermission(new
                    SerializablePermission("enableSubclassImplementation"));
        } 
        return null; 
    } 
    private OutputStream(Void ignore) { }
 
    /** 
     * Create a new instance of this class. 
     * 
     * throw SecurityException if SecurityManager is installed and 
     * enableSubclassImplementation SerializablePermission 
     * is not granted or jdk.corba.allowOutputStreamSubclass system 
     * property is either not set or is set to 'false' 
     */ 
    public OutputStream() {