Code example for NotSerializableException

0
        fetchedParams = true;
    } 
 
    private void writeObject(ObjectOutputStream stream) throws IOException {
        if (getOpenSSLKey().isEngineBased()) { 
            throw new NotSerializableException("engine-based keys can not be serialized");
        } 
        ensureReadParams(); 
        stream.defaultWriteObject();
    } 
}