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