Basic HTML version of Foils prepared 18 May 97

Foil 25 I/O Streams

From Java Tutorial - Spring 1997 Part 4: Multithreading, useful Java classes, I/O, Networking, and the future Peking Tutorial, Web Certificate -- Spring-Summer 1997. by Nancy J. McCracken,Geoffrey C. Fox


1 Streams are an abstraction of a sequence of bytes.
2 The sources and destinations of these sequences can be
  • files
  • network connections
  • blocks of memory
3 That is, all of these types of I/O are treated in the same way.
4 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()
5 There are also methods for reading and writing arrays of bytes.
6 These methods all "block" on the read or write during the data 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 Thu Jan 8 1998