<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.io.SequenceInputStream
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.io.html">This Package</a>  <a href="java.io.Reader.html#_top_">Previous</a>  <a href="java.io.StreamTokenizer.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.io.SequenceInputStream
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.io.InputStream.html#_top_">java.io.InputStream</a>
           |
           +----java.io.SequenceInputStream
</pre>
<hr>
<dl>
  <dt> public class <b>SequenceInputStream</b>
  <dt> extends <a href="java.io.InputStream.html#_top_">InputStream</a>
</dl>
The sequence input stream class allows an application to combine 
 several input streams serially and make them appear as if they 
 were a single input stream. Each input stream is read from, in 
 turn, until it reaches the end of the stream. The sequence input 
 stream class then closes that stream and automatically switches to 
 the next input stream.
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#SequenceInputStream(java.util.Enumeration)"><b>SequenceInputStream</b></a>(Enumeration)
  <dd>  Constructs a new sequence input stream initialized to the 
 specified enumeration of input streams.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#SequenceInputStream(java.io.InputStream, java.io.InputStream)"><b>SequenceInputStream</b></a>(InputStream, InputStream)
  <dd>  Constructs a new sequence input stream initialized to read first 
 from the input stream <code>s1</code>, and then from the input 
 stream <code>s2</code>.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#available()"><b>available</b></a>()
  <dd>  Returns the number of bytes available on the current stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#close()"><b>close</b></a>()
  <dd>  Closes this input stream and releases any system resources 
 associated with the stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#read()"><b>read</b></a>()
  <dd>  Reads the next byte of data from this input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#read(byte[], int, int)"><b>read</b></a>(byte[], int, int)
  <dd>  Reads up to <code>len</code> bytes of data from this input stream 
 into an array of bytes.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="SequenceInputStream"></a>
<a name="SequenceInputStream(java.util.Enumeration)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>SequenceInputStream</b>
<pre>
 public SequenceInputStream(<a href="java.util.Enumeration.html#_top_">Enumeration</a> e)
</pre>
<dl>
  <dd> Constructs a new sequence input stream initialized to the 
 specified enumeration of input streams. Each object in the 
 enumeration must be an <code>InputStream</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> e - an enumeration of input streams.
    <dt> <b>See Also:</b>
    <dd> <a href="java.util.Enumeration.html#_top_">Enumeration</a>
  </dl></dd>
</dl>
<a name="SequenceInputStream(java.io.InputStream, java.io.InputStream)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>SequenceInputStream</b>
<pre>
 public SequenceInputStream(<a href="java.io.InputStream.html#_top_">InputStream</a> s1,
                            <a href="java.io.InputStream.html#_top_">InputStream</a> s2)
</pre>
<dl>
  <dd> Constructs a new sequence input stream initialized to read first 
 from the input stream <code>s1</code>, and then from the input 
 stream <code>s2</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> s1 - the first input stream to read.
    <dd> s2 - the second input stream to read.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="available()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="available"><b>available</b></a>
<pre>
 public int available() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Returns the number of bytes available on the current stream.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#available()">available</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
  </dl></dd>
</dl>
<a name="read()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="read"><b>read</b></a>
<pre>
 public int read() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads the next byte of data from this input stream. The byte is 
 returned as an <code>int</code> in the range <code>0</code> to 
 <code>255</code>. If no byte is available because the end of the 
 stream has been reached, the value <code>-1</code> is returned. 
 This method blocks until input data is available, the end of the 
 stream is detected, or an exception is thrown. 
 <p>
 The <code>read</code> method of <code>SequenceInputStream</code> 
 tries to read one character from the current substream. If it 
 reaches the end of the stream, it calls the <code>close</code> 
 method of the current substream and begins reading from the next 
 substream.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next byte of data, or <code>-1</code> if the end of the
             stream is reached.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#read()">read</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
  </dl></dd>
</dl>
<a name="read(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="read"><b>read</b></a>
<pre>
 public int read(byte buf[],
                 int pos,
                 int len) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads up to <code>len</code> bytes of data from this input stream 
 into an array of bytes. This method blocks until at least 1 byte 
 of input is available. If the first argument is <code>null</code>, 
 up to <code>len</code> bytes are read and discarded. 
 <p>
 The <code>read</code> method of <code>SequenceInputStream</code> 
 tries to read the data from the current substream. If it fails to 
 read any characters because the substream has reached the end of 
 the stream, it calls the <code>close</code> method of the current 
 substream and begins reading from the next substream.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the buffer into which the data is read.
    <dd> off - the start offset of the data.
    <dd> len - the maximum number of bytes read.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#read(byte[], int, int)">read</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
  </dl></dd>
</dl>
<a name="close()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="close"><b>close</b></a>
<pre>
 public void close() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Closes this input stream and releases any system resources 
 associated with the stream. 
 <p>
 The <code>close</code> method of <code>SequenceInputStream</code> 
 calls the <code>close</code> method of both the substream from 
 which it is currently reading and the <code>close</code> method of 
 all the substreams that it has not yet begun to read from.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#close()">close</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.io.html">This Package</a>  <a href="java.io.Reader.html#_top_">Previous</a>  <a href="java.io.StreamTokenizer.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
