package test;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
public class File_Test {
public static void main(String[] args) throws Exception {
String str = "中国人";
PrintWriter pw = new PrintWriter("1.txt", "utf-8");
pw.write(str);
pw.close();
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("1.txt"), "utf-8"));
String myStr = br.readLine();
br.close();
System.out.println(myStr);
}
}