ABSTRACT

In chapter 1 we saw how to use scala.io.Source and java.util.Scanner to read from text files. We also saw how we could use java.io.PrintWriter to write text files. In this chapter we will explore the overall structure of the java.io package and see how streams can be used to represent a general approach to input and output. This will set us up in the following chapter to use streams for network communication. We will also explore the use of XML in Scala as another format for storing or communicating data.