mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 16:36:56 +07:00
17 lines
421 B
Java
17 lines
421 B
Java
import java.nio.charset.StandardCharsets;
|
|
|
|
// "Replace with 'StandardCharsets.UTF_16'" "true"
|
|
class Test {
|
|
void test(byte[] bytes) {
|
|
String string = null;
|
|
try {
|
|
string = new String(bytes, StandardCharsets.UTF_16);
|
|
}
|
|
catch (NullPointerException exception) {
|
|
System.out.println("ex1");
|
|
}
|
|
if(string.startsWith("Foo")) {
|
|
System.out.println("It's a foo!");
|
|
}
|
|
}
|
|
} |