
org.cryptomator.windows.common.WinStrings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of integrations-win Show documentation
Show all versions of integrations-win Show documentation
Provides optional Windows services used by Cryptomator
The newest version!
package org.cryptomator.windows.common;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
public class WinStrings {
// visible for testing
public static byte[] getNullTerminatedUTF16Representation(String source) {
byte[] bytes = source.getBytes(StandardCharsets.UTF_16LE);
return Arrays.copyOf(bytes, bytes.length + 2); // add double-width null terminator 0x00 0x00
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy