| Managing Input/Output Files in Java |
| |
| Streams |
| |
| A stream is a path of communication between the source
of some information and its destination. This information
can come from a file, the computer's memory, or even from the Internet. |
| |
| A stream is a path of communication between a
source of information and its destination. |
| For example, |
| An input stream allows us to read data from a source, and
an output stream allows us to write data to a destination. |
| |
| |
| The java.io Package |
| To import each individual class or to import
the entire java.io package, like this: |
import java.io.InputStream;
import java.io.FilteredInputStream;
import java.io.FileOutputStream;
import java.io.*; |
| |
|
| The foundations of this stream framework in the Java
class hierarchy are the two abstract classes, InputStream and OutputStream. |
| Inheriting from these classes is a virtual
cornucopia of categorized subclasses, demonstrating the wide range of
streams in the system, but also demonstrating an extremely well-designed
hierarchy of relationships between these streams-one well worth learning from. |
| |
| |
|
|
| |
| |