mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-08 21:52:48 +07:00
20 lines
549 B
Java
20 lines
549 B
Java
// "Replace with 'StandardCharsets.UTF_16'" "false"
|
|
import java.io.UnsupportedEncodingException;
|
|
|
|
class Test {
|
|
static final String MY_ENCODING = "UTF-16";
|
|
|
|
void test(byte[] bytes) {
|
|
String string = null;
|
|
try {
|
|
// Do not suggest the replacement as "MY_ENCODING" could be a tuneable constant
|
|
string = new String(bytes, MY_ENCO<caret>DING);
|
|
}
|
|
catch (UnsupportedEncodingException exception) {
|
|
exception.printStackTrace();
|
|
}
|
|
if(string.startsWith("Foo")) {
|
|
System.out.println("It's a foo!");
|
|
}
|
|
}
|
|
} |