I/O Streams
A stream is a sequence of bytes or characters.
Stream sources and sinks include:
- files
- network connections
- blocks of memory
- threads
That is, all types of streams are treated similarly.
The most basic byte streams are InputStream and OutputStream. These classes have methods that can read or write a byte from or to a stream:
- int read();
- void write( int );
- skip( long ); available(); flush(); close();
All of the above methods throw a possible IOException.
The read() and write( int ) methods "block" during transfer.