首页>itarticle>how many ways to read a file in java?
how many ways to read a file in java?
admin11月 14, 20200
The number of total classes of Java I/O is large, and it is easy to get confused when to use which. The following are methods for reading a file line by line.
Read a file line by line
1
2
3
4
5
6
7
8
9
10
11
12
13
privatestaticvoid(File fin)throws IOException {
FileInputStream fis = new FileInputStream(fin);
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
近期评论