package test;
import java.io.IOException;
public class test {
public static void main(String[] args) throws IOException {
// 编码:
String str = "你好";
byte[] buf = str.getBytes();// 此处使用系统默认编码集,也可手动指定如:byte[] buf = str.getBytes("utf-8");
// 解码:
String s1 = new String(buf);// 此处使用系统默认编码集,也可手动指定如:String s1 = new String(buf, "utf-8");
}
}
Java_IO流_编码解码
最新推荐文章于 2021-02-27 06:17:39 发布