Working with Files

Now that you've had an introduction to the stream classes, you can put your knowledge to work. Perhaps the most common use of I/O—outside of retrieving data from the keyboard and displaying data onscreen—is file I/O. Any program that wants to retain its status (including the status of any edited files) must be capable of loading and saving files. Java provides several classes—including File, FileDescriptor, RandomAccessFile, FileInputStream, FileOutputStream, FilePermission, FileReader, and FileWriter—for dealing with files. In this section, you examine these classes and get a chance to see how they work.

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.