import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import javax.imageio.stream.FileImageInputStream;
public class DeMo5 {
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
InputStream fr = new FileInputStream("d:\\a.txt");
OutputStream fw = new FileOutputStream("d:\\b.txt");
byte[] buf = new byte[1024];
while((fr.read(buf))!=-1){
Arrays.sort(buf);
fw.write(buf);
}
fw.flush();
fr.close();
fw.close();
}
}
上述代码为什么Arrays.sort(buf)在这里不能用?还是我的机器问题?求指点... |
|