Basic HTML version of Foils prepared Sept 21 1998

Foil 28 I/O Streams

From Java Tutorial 98- 4: Multi-Treading, Useful Java Classes, I/O and Networking NAVO Tutorial -- Sept 23 1998. by Geoffrey C. Fox, Nancy McCracken

Java I/O stream constructors for Foil 28
1 A stream is a sequence of bytes or characters.
2 Stream sources and sinks include:
  • files
  • network connections
  • blocks of memory
  • threads
3 That is, all types of streams are treated similarly.
4 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();
5 All of the above methods throw a possible IOException.
6 The read() and write( int ) methods "block" during transfer.

in Table To:


© 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 Nov 28 1998