code: public static void writeValue(String keyName, String valueName, String value) throws RegistryException {
          try (Key key = Key.open(keyName, KEY_WRITE)) {
              checkError(invoke(Methods.REG_SET_VALUE_EX.get(), key.id, toByteArray(valueName), toByteArray(value)));
          }
      }
docs: Writes a string value with a given key and value name.
  
  @param keyName Name of the key to write the value in.
  @param valueName Name of the value.
  @param value Content of the value.
  @throws RegistryException