Hi Mary,
There are so many I/O classes they can be intimidating at first
I found it helped to remember them as paired sets.
byte streams = input streams and output streams; they can't handle characters
If the class is named
somethingInputStream; it extends InputStream. Nearly always has a matching
somethingOutputStream which extends OutputStream.
character streams = readers and writers
If the class is named
somethingReader; it extends Reader. Nearly always has a matching
somethingWriter which extends Writer.
Anything requiring an InputStream (or OutputStream) can take one of its subclasses.
Anything requiring a Reader (or Writer) can take one of its subclasses.
The exceptions to the above are:
FilexxxStreams - they require a File, FileDescriptor or
String containing a file name
RandomAccessFile which implements both the DataInput and DataOutput interfaces and only takes a File or the String name of a file.
The
Sun tutorial on I/O Streams has some diagrams that make the relationships easier to see.
Hope that helps.
------------------
Jane Griscti
Sun Certified
Java 2 Programmer