Basic HTML version of Foils prepared June 5 99

Foil 64 Streams

From Java Language in the Computer Science Curriculum ADMI Tutorial Duluth Minnesota -- June 3 99. by Geoffrey C. Fox


A stream is a sequence of bytes or characters.
All types of streams are treated similarly, but may have different stream sources and sinks:
  • files
  • network connections
  • blocks of memory
  • threads
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.



© 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 Sat Jun 5 1999