All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cryptomator.windows.common.WinStrings Maven / Gradle / Ivy

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