Java I/O provides a very powerful and adaptable set of tools. The
designers sought to devise a general set of classes and methods
that you can combine in different ways to attack different kinds
of I/O tasks.
For example, whether one reads from the keyboard, from a local
file, or from a file over the internet, the stream of data
will look the same to a high level read method.
However, Java I/O is complicated. Just doing something as basic
as writing data to a file can involve the instantiation of two or
three classes. That is why we avoided Java I/O, other than System.out.println(),
until now. (An approach of some books is to provide a set of custom
tools for basic I/O that are simple to use.)
This introduction to Java IO provides the following:
- Overview of Java I/O
- Stream - the essential concept in
- Wrappers - add capabilities to a
stream class by wrapping it with a higher level class.
- Console I/O provides useful interaction
- Text output
- J2SE5.0 brings a new class and method for formatted numerical
- Text input
- the new class in J2SE5.0 for formatted input.
- File Class - this class provides
an identifier for a file.
- File I/O - the stream classes
for reading/writing with files.
- Text output to a file - writing/reading
characters to files
output to a file
- Text input from a file
input from a file
- File I/O - Binary - writing/reading
- Character encoding
- Object I/O
- Converting primitive types to bytes and back
- Sources, destinations, and filters
- File Chooser Dialog - browse local
directories with a JFileChooser.
- Other I/O Topics - brief look
at other IO classes
Latest update: Nov. 10, 2004