Java Reference
In-Depth Information
CHAPTER
16
Input and Output
The java.io package contains nearly every class you might ever need to per-
form input and output (I/O) in Java. In this chapter, I will discuss how the
java.io classes are used, including an overview of the java.io package, streams
versus readers and writers, low-level and high-level streams, chaining
streams, serialization, and logging.
An Overview of the java.io Package
The java.io package contains dozens of classes and interfaces for performing
input and output. At first, the java.io package might seem intimidating, but
after you understand the various categories of streams, you will be able to
quickly find the classes you need to perform any I/O.
Almost all of the classes in the java.io package fit into one of the following
two categories:
Streams. The stream classes are for performing I/O on bytes of data.
Readers and Writers.
The reader and writer classes are for performing
I/O on characters.
551
Search WWH ::




Custom Search