189_IO流_FileReader_文件字符输入流_详解

来源:互联网 发布:破解软件网盘 编辑:程序博客网 时间:2024/06/05 19:37
package TestIO;import java.io.*;public class Test01 {public static void main(String[] args) throws Exception {    //FileReader  fr = new FileReader("C:/Users/张东林/Desktop/中国电视台直播源.txt");char[] chars= new char[512];int temp = 0;while( (temp = fr.read(chars)) != -1 ){System.out.print(new String(chars,0,temp));}        fr.close();}}

0 0