课程: Java 8+ Essential Training: Objects and APIs

今天就学习课程吧!

今天就开通帐号,24,600 门业界名师课程任您挑!

Copy files with readers and buffers

Copy files with readers and buffers

- [Instructor] The Java class library includes two completely separate file I/O systems: the original set of interfaces and classes that was delivered with Java back in 1995 and has evolved somewhat since then, and a completely new version that was delivered with Java 7. In this demonstration of copying a file, I'll use a technique that's available in all versions of Java, including Android's implementation. This project includes a file called loremipsum.txt. It's in a file subdirectory and it contains a bunch of text. Now when you open this file in your copy of IntelliJ IDEA, the code may not be wrapped, if you want to see it wrapped, go to the settings or preferences dialog, then go to editor, general and select the option, use soft wraps in editor and then you'll be able to see all of the text as I am showing it here. In the main method of the main class of this project, I'm going to create a variable called source file that points to that file. Notice I'm addressing this file…

内容