Java Reference
In-Depth Information
CHAPTER
19
B
INARY
I/O
Objectives
To discover how I/O is processed in Java (§19.2).
■
To distinguish between text I/O and binary I/O (§19.3).
■
To read and write bytes using
FileInputStream
and
FileOutputStream
(§19.4.1).
■
To filter data using the base classes
FilterInputStream
and
FilterOutputStream
(§19.4.2).
■
To read and write primitive values and strings using
DataInputStream
and
DataOutputStream
(§19.4.3).
■
To improve I/O performance by using
BufferedInputStream
and
BufferedOutputStream
(§19.4.4).
■
To write a program that copies a file (§19.5).
■
To store and restore objects using
ObjectOutputStream
and
ObjectInputStream
(§19.6).
■
To implement the
Serializable
interface to make objects serializable
(§19.6.1).
■
To serialize arrays (§19.6.2).
■
To read and write files using the
RandomAccessFile
class (§19.7).
■