1:JDK4 New IO classes to understand
Buffer (buffered), Channer (channel)
2:jdk7 New IO classes to know
Path: Platform-independent paths.
Paths: Contains a static method that returns path.
public static path Get (URI uri): Determines the file path based on the given URI. Files: The tool class for manipulating files. Provides a number of ways to
Learn the following simple ways
public static long copy (Path source, outputstream out): Copy file
public static Path Write (path path, iterable<? extends charsequence> lines, Charset cs, openoption ... options): Sets the Data is written to a file.
1 // 2 files.copy (Paths.get ("Demo.java"), Newfileoutputstream (" Copy.java " 3 // write the data in the collection to a file 5 list<string > list = new arraylist<string> (); 6 list.add ("Hello" ); 7 List.add ("World" 8 list.add ("java" 9 Files.write (Paths.get ("List.txt"), List, Charset.forname ("GBK"));
Java 21-15 new IO stream NIO