Name
SequenceInputStream
Synopsis
This
class provides a way of seamlessly
concatenating the data from two or more input streams. It provides an
InputStream
interface to a sequence of
InputStream
objects. Data is read from the streams
in the order in which the streams are specified. When the end of one
stream is reached, data is automatically read from the next stream.
This class might be useful, for example, when implementing an include
file facility for a parser.
Figure 9-55. java.io.SequenceInputStream
public class SequenceInputStream extends InputStream { // Public Constructors public SequenceInputStream(java.util.Enumeration<? extends InputStream> e); public SequenceInputStream(InputStream s1, InputStream s2); // Public Methods Overriding InputStream 1.1 public int available( ) throws IOException; public void close( ) throws IOException; public int read( ) throws IOException; public int read(byte[ ] b, int off, int len) throws IOException; }
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.