public void saveToCache(String id, Program program) {
        if (tmpFolder == null) {
            return; //low permissions
        }
        //get file
        File file = new File(tmpFolder, getCleanFileName(id));
        //get binaries
        ByteBuffer bb;
        try {
            bb = program.getBinary(device);
        } catch (UnsupportedOperationException | OpenCLException ex) {
            LOG.log(Level.WARNING, "Unable to retrieve the program binaries", ex);
            return;
        }
        byte[] bytes = new byte[bb.remaining()];
        bb.get(bytes);
        //save
        try {
            Files.write(file.toPath(), bytes);
        } catch (IOException ex) {
           LOG.log(Level.WARNING, "Unable to save program binaries to the cache", ex);
        }
    }
Saves the specified program in the cache.
The parameter {@code id} denotes the name of the program. Under this id,
the program is then loaded again by {@link #loadFromCache(java.lang.String, java.lang.String) }.
<br>
The id must be unique, otherwise collisions within the cache occur.
Therefore, the following naming schema is recommended:
{@code id = <full name of the class using the program>.<unique identifier within that class>}.

@param id the program id
@param program the program to store in the cache
jme3-core/src/main/java/com/jme3/opencl/ProgramCache.java