Special Class for random file read/write -- RandomAccessFile, randomaccessfile
The RandomAccessFile class can read files randomly, but it is not useful in testing;
File can be used to test whether a File exists or not;
The FileWriter class can overwrite or Append content to a file;
The FileReader class can read the content of ordered files. Generally, it is packaged with processing streams (such as bytes and BufferedReader;
BufferedReader/BufferedWriter class, suitable for reading and writing text files;
BufferedInputStream/BufferedOutputStream class, suitable for files containing binary data;
You can also use the static method of File to create a BufferedReader object and specify the encoding:
BufferedReader in = File. newBufferedReader (Paths. get ("input.txt"), Charset. forName ("UTF-8 "));
The delimiter class has a useDelimiter method, which can specify a separator (expressed in a regular expression, default space), and then uses this separator to cut the string;
Reference link: http://m.blog.csdn.net/article/details? Id = 51234056