private int getString(long object, long arg, int parameterName, APIBuffer buffer) {
        // Get string length
        int errcode = get(object, arg, parameterName, 0, NULL, buffer.address());
        if (DEBUG) {
            checkCLError(errcode);
        }

        int bytes = (int) buffer.pointerValue(0);
        buffer.bufferParam(bytes + POINTER_SIZE);

        // Get string
        errcode = get(object, arg, parameterName, bytes, buffer.address(), NULL);
        if (DEBUG) {
            checkCLError(errcode);
        }

        return bytes - 1; // all OpenCL char[] parameters are null-terminated
    }
Returns the string value for the specified {@code parameterName}. The raw
bytes returned are assumed to be UTF-8 encoded and have length equal to {@code
parameterValueSize}.

@param object the object to query
@param arg an object argument
@param parameterName the parameter to query
@param parameterValueSize the explicit string length

@return the parameter's string value
jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/info/InfoQueryObject.java