I/O in Java

The sometimes confusing world of Java I/O

Java supports many kinds of I/O Streams.

Specialized by the type of data processed

Specialized by how the data is processed

What do we really have to know?

Java 1.7 and beyond

Starting with version 1.7, Java has a new package java.nio.file for handling file access. This package is much more sophiscated the the present java.io.file class. This new package is not used in the textbook, and we will not use it in class.

As far as I can I tell, you can use the following statement to open a file as a Scanner using the classes of the java.nio.file package.

new Scanner(FileSystems.getDefault().getPath("inFile.txt").toFile()) ;