import java.io.*;
public class IOTest
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("in.txt"),"GB2312"));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("out.txt"),"GB2312"));
String data = null;
while((data = br.readLine())!=null)
{
System.out.println(data);
bw.write(data);
bw.newLine();
}
br.close();
bw.close();
}
}
Buffered读写中文文件乱码
最新推荐文章于 2023-12-20 17:08:41 发布