Basic HTML version of Foils prepared May 12 1996

Foil 128 Input/Output in Java -- InputStreams -- I

From CRPC Lectures on Java Language Applets Graphics CRPC Annual Meeting Tutorial -- May 14,1996. by Geoffrey C. Fox


1 In java.io, there are several classes that throw IOExceptions -- please catch them!
2 The class InputStream is basic and it has methods such as read() skip() (bytes in a stream) available() (bytes remaining in stream) close().
3 InputStreams can be created from memory
4 InputStream s = new ByteArrayInputStream(buffer, 100, 300); // creates a stream of 300 bytes in locations 100 to 399
5 More usefully, they can be created from a UNIX file
6 InputStream s = new FileInputStream("/usr/gcf/greatidea");

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 Sun Dec 14 1997