标签:nts pac flush port rac int stack rgs main
package 文件读取;
import java.io.*;
import java.util.*;
public class File {
public static void main(String[] args)throws Exception
{
FileReader file_source=null;
FileWriter file_destination=null;
try
{
file_source=new FileReader("D:/a.txt");
file_destination=new FileWriter("D:/b.txt");
char[] buf=new char[1024];
int len=0;
while((len=file_source.read(buf))!=-1)
{
// Sort(buf);
Arrays.sort(buf);
System.out.println(buf);
file_destination.write(buf,0,len);
file_destination.flush();
}
}
catch(IOException e)
{
e.printStackTrace();
}
finally
{
try
{
if(file_source!=null)
file_source.close();
}
catch(IOException e)
{
e.printStackTrace();
}
try
{
if(file_destination!=null)
file_destination.close();
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
}
标签:nts pac flush port rac int stack rgs main
原文地址:https://www.cnblogs.com/4910yxq/p/9256393.html