/** * Writes a DWORD value. */ public void setValue(String name, int value) { byte[] data = new byte[4]; data[0] = (byte) (value & 0xff); data[1] = (byte) ((value >> 8) & 0xff); data[2] = (byte) ((value >> 16) & 0xff); data[3] = (byte) ((value >> 24) & 0xff); check(Advapi32.INSTANCE.RegSetValueEx(handle, name, 0, WINNT.REG_DWORD, data, data.length)); }
/** * Writes a String value. */ public void setValue(String name, String value) { try { byte[] bytes = value.getBytes("UTF-16LE"); int newLength = bytes.length+2; // for 0 padding byte[] with0 = new byte[newLength]; System.arraycopy(bytes, 0, with0, 0, newLength); check(Advapi32.INSTANCE.RegSetValueEx(handle, name, 0, WINNT.REG_SZ, with0, with0.length)); } catch (UnsupportedEncodingException e) { throw new AssertionError(e); } }
/** * Writes a DWORD value. */ public void setValue(String name, int value) { byte[] data = new byte[4]; data[0] = (byte) (value & 0xff); data[1] = (byte) ((value >> 8) & 0xff); data[2] = (byte) ((value >> 16) & 0xff); data[3] = (byte) ((value >> 24) & 0xff); check(Advapi32.INSTANCE.RegSetValueEx(handle, name, 0, WINNT.REG_DWORD, data, data.length)); }
/** * Writes a DWORD value. */ public void setValue(String name, int value) { byte[] data = new byte[4]; data[0] = (byte) (value & 0xff); data[1] = (byte) ((value >> 8) & 0xff); data[2] = (byte) ((value >> 16) & 0xff); data[3] = (byte) ((value >> 24) & 0xff); check(Advapi32.INSTANCE.RegSetValueEx(handle, name, 0, WINNT.REG_DWORD, data, data.length)); }
/** * Writes a DWORD value. */ public void setValue(String name, int value) { byte[] data = new byte[4]; data[0] = (byte) (value & 0xff); data[1] = (byte) ((value >> 8) & 0xff); data[2] = (byte) ((value >> 16) & 0xff); data[3] = (byte) ((value >> 24) & 0xff); check(Advapi32.INSTANCE.RegSetValueEx(handle, name, 0, WINNT.REG_DWORD, data, data.length)); }
/** * Writes a String value. */ public void setValue(String name, String value) { try { byte[] bytes = value.getBytes("UTF-16LE"); int newLength = bytes.length+2; // for 0 padding byte[] with0 = new byte[newLength]; System.arraycopy(bytes, 0, with0, 0, newLength); check(Advapi32.INSTANCE.RegSetValueEx(handle, name, 0, WINNT.REG_SZ, with0, with0.length)); } catch (UnsupportedEncodingException e) { throw new AssertionError(e); } }
/** * Writes a String value. */ public void setValue(String name, String value) { try { byte[] bytes = value.getBytes("UTF-16LE"); int newLength = bytes.length+2; // for 0 padding byte[] with0 = new byte[newLength]; System.arraycopy(bytes, 0, with0, 0, newLength); check(Advapi32.INSTANCE.RegSetValueEx(handle, name, 0, WINNT.REG_SZ, with0, with0.length)); } catch (UnsupportedEncodingException e) { throw new AssertionError(e); } }
/** * Writes a String value. */ public void setValue(String name, String value) { try { byte[] bytes = value.getBytes("UTF-16LE"); int newLength = bytes.length+2; // for 0 padding byte[] with0 = new byte[newLength]; System.arraycopy(bytes, 0, with0, 0, newLength); check(Advapi32.INSTANCE.RegSetValueEx(handle, name, 0, WINNT.REG_SZ, with0, with0.length)); } catch (UnsupportedEncodingException e) { throw new AssertionError(e); } }