File I/O

Java supports stream-based file input and output through the File, FileDescriptor, FileInputStream, and FileOutputStream classes. It supports direct or random access I/O using the File, FileDescriptor, and RandomAccessFile classes. Random access I/O is covered later in this chapter. The FileReader and FileWriter classes support Unicode-based file I/O. These classes are also covered later in this chapter.

The File class provides access to file and directory objects and supports many operations on files and directories. The FileDescriptor class encapsulates the information used by the host system to track files that are being accessed. The FileInputStream and FileOutputStream classes provide the capability to read and write to file streams. ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams 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.