This discussed the basics of handling input and output of text (data composed of characters rather than raw bytes) using readers and writers.
You learned that data manipulation of text input and output in Java is not really that different from byte-oriented input and output.
However, depending on the encoding used, the same sequence of bytes can have two completely different meanings in two different character sets, so it is important to know with what character set you are working.
The java.io.Reader and java.io.Writer classes and their various subclasses can handle the necessary conversions between the different character sets and the Unicode Java uses internally.
You also learned about using the FileReader and FileWriter classes to read and write text files.
The java.io package also contains two deprecated classes that are not shown
in the preceding table:
LineNumberInputStream and
StringBufferInputStream.
These classes should not be used for new code.
The following interfaces are defined by java.io:
As you can see, there are many classes and interfaces in the java.io package.
These include byte and character streams, and object serialization (the storage and retrieval of objects).
This module examined several commonly used I/O components.
We begin our discussion with one of the most distinctive I/O classes.
In the next module, you will learn about the different types of readers and writers, including the
BufferedReader and BufferedWriter classes
StringReader and StringWriter classes
CharArrayReader and CharArrayWriter classes
You will also learn how to write subclasses of FilterReader and FilterWriter that manipulate text before passing it on.