mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-31 19:38:50 +07:00
GitOrigin-RevId: f328b47c3c64b6f078f89fa04f0353ec34d57f24
26 lines
819 B
Java
26 lines
819 B
Java
import java.io.ByteArrayOutputStream;
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.nio.charset.Charset;
|
|
|
|
class Main {
|
|
void string() {
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
String s = new <warning descr="Inefficient conversion from ByteArrayOutputStream">String</warning>(baos.toByteArray());
|
|
}
|
|
|
|
void charset() {
|
|
Charset charset = Charset.defaultCharset();
|
|
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
String s = new String(baos.toByteArray(), charset);
|
|
}
|
|
|
|
void charsetName() throws UnsupportedEncodingException {
|
|
String csn = "ISO-8859-1";
|
|
|
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
|
String s = new <warning descr="Inefficient conversion from ByteArrayOutputStream">String</warning>(baos.toByteArray(), csn);
|
|
}
|
|
|
|
|
|
} |