测试代码如下
package test;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PushbackInputStream;
import java.io.Reader;
import java.nio.charset.Charset;
public class test
{
public static void main(String[] args) throws IOException
{
File file = new File("D:/222.txt");
String content=txt2String(file);
}
public static String txt2String(File file) throws IOException{
/* InputStreamReader read = new InputStreamReader(
new FileInputStream(file), "UTF-8");
BufferedReader br = new BufferedReader(read);*/
BufferedReader br = new BufferedReader(new UnicodeReader(new FileInput