java.nio.charset.ModifiedUtf8 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtransc-rt Show documentation
Show all versions of jtransc-rt Show documentation
JVM AOT compiler currently generating JavaScript, C++, Haxe, with initial focus on Kotlin and games.
package java.nio.charset;
public class ModifiedUtf8 {
public static void encode(byte[] out, int offset, String str) {
byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
System.arraycopy(bytes, 0, out, offset, bytes.length);
}
public static long countBytes(String str, boolean b) {
return str.getBytes(StandardCharsets.UTF_8).length;
}
public static byte[] encode(String str) {
return str.getBytes(StandardCharsets.UTF_8);
}
public static String decode(byte[] in, char[] temp, int offset, int bytes) {
return new String(in, offset, bytes, StandardCharsets.UTF_8);
}
}