HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 4 February 97

Foil 43 I/O Streams

From Feb 3 Delivered Lecture for Course CPS616 -- Java Lecture 4 -- AWT Through I/O CPS616 spring 1997 -- Feb 3 1997. by Nancy McCracken * See also color IMAGE
Secs 131
Streams are an abstraction of a sequence of bytes.
The sources and destinations of these sequences can be
  • files
  • network connections
  • blocks of memory
That is, all of these types of I/O are treated in the same way.
The most basic I/O streams are InputStream and OutputStream. These classes have methods that can read or write a byte from the stream:
  • int read ();
  • void write (byte);
  • also skip(), available(), close()
There are also methods for reading and writing arrays of bytes.
These methods all "block" on the read or write during the data transfer.


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Feb 16 1997