mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
19 lines
450 B
Java
19 lines
450 B
Java
// "Replace with 'StandardCharsets.UTF_16'" "true"
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
class Test {
|
|
static final String UTF16 = "UTF-16";
|
|
|
|
void test(byte[] bytes) {
|
|
String string = null;
|
|
try {
|
|
string = new String(bytes, UTF<caret>16);
|
|
}
|
|
catch (UnsupportedEncodingException exception) {
|
|
exception.printStackTrace();
|
|
}
|
|
if(string.startsWith("Foo")) {
|
|
System.out.println("It's a foo!");
|
|
}
|
|
}
|
|
} |