标签:writer java代码 技术 输出 inf 需要 reader adl 技术分享
InputStreamReader inputstreamreader1=new InputStreamReader(System.in); InputStreamReader inputstreamreader2=new InputStreamReader(new FileInputStream("/opt/xxx")); InputStreamReader inputstreamreader3=new InputStreamReader(new FileInputStream(new File("/opt/xxx")));
FileReader f1=new FileReader("/opt/xxx.txt"); FileReader f2=new FileReader(new File("/opt/xxx.txt"));
BufferedReader buffered_filereader=new BufferedReader(new FileReader(filename)); BufferedReader buffered_inputstreamreader=new BufferedReader(new InputStreamReader(fileinputstream));
String read; while((read=buffered_filereader.readLine())!=null){ System.out.println(read); }
int i; while ((i=filereader.read())!=-1){ System.out.print((char)i); }
String filename="/opt/xxx.log"; FileInputStream fileinputstream=new FileInputStream(filename); InputStreamReader inputstreamreader=new InputStreamReader(fileinputstream); int i; while ((i=inputstreamreader.read())!=-1){ System.out.print((char)i); }
String filename="/opt/xxx.log"; FileReader filereader=new FileReader(filename); int i; while ((i=filereader.read())!=-1){ System.out.print((char)i); }
String filename="/opt/xxx.log"; FileReader filereader=new FileReader(filename); BufferedReader buffered_filereader=new BufferedReader(filereader); String read; while((read=buffered_filereader.readLine())!=null){ System.out.println(read); }
String filename="/opt/xxx.log"; FileInputStream fileinputstream=new FileInputStream(filename); InputStreamReader inputstreamreader=new InputStreamReader(fileinputstream); BufferedReader buffered_inputstreamreader=new BufferedReader(inputstreamreader); String read; while((read=buffered_inputstreamreader.readLine())!=null){ System.out.println(read); }
Java读取文件-BufferedReader/FileReader/InputStreamReader/FileInputStream的关系和区别
标签:writer java代码 技术 输出 inf 需要 reader adl 技术分享
原文地址:https://www.cnblogs.com/meitian/p/8992769.html