<!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.FilterInputStream
</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.FileWriter.html#_top_">Previous</a>  <a href="java.io.FilterOutputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.io.FilterInputStream
</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.FilterInputStream
</pre>
<hr>
<dl>
  <dt> public class <b>FilterInputStream</b>
  <dt> extends <a href="java.io.InputStream.html#_top_">InputStream</a>
</dl>
This class is the superclass of all classes that filter input 
 streams. These streams sit on top of an already existing input 
 stream (the <i>underlying</i> input stream), but provide 
 additional functionality. 
 <p>
 The class <code>FilterInputStream</code> itself simply overrides 
 all methods of <code>InputStream</code> with versions that pass 
 all requests to the underlying input stream. Subclasses of 
 <code>FilterInputStream</code> may further override some of these 
 methods as well as provide additional methods and fields.
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#in"><b>in</b></a>
  <dd>  The underlying input stream.
</dl>
<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="#FilterInputStream(java.io.InputStream)"><b>FilterInputStream</b></a>(InputStream)
  <dd>  Creates an input stream filter built on top of the specified 
 input stream.
</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 that can be read from this input 
 stream without blocking.
  <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="#mark(int)"><b>mark</b></a>(int)
  <dd>  Marks the current position in this input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#markSupported()"><b>markSupported</b></a>()
  <dd>  Tests if this input stream supports the <code>mark</code> 
 and <code>reset</code> methods.
  <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[])"><b>read</b></a>(byte[])
  <dd>  Reads up to <code>byte.length</code> bytes of data from this 
 input stream into an array of bytes.
  <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.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#reset()"><b>reset</b></a>()
  <dd>  Repositions this stream to the position at the time the 
 <code>mark</code> method was last called on this input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#skip(long)"><b>skip</b></a>(long)
  <dd>  Skips over and discards <code>n</code> bytes of data from the 
 input stream.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="in"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>in</b>
<pre>
 protected <a href="java.io.InputStream.html#_top_">InputStream</a> in
</pre>
<dl>
  <dd> The underlying input stream.<p>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="FilterInputStream"></a>
<a name="FilterInputStream(java.io.InputStream)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>FilterInputStream</b>
<pre>
 protected FilterInputStream(<a href="java.io.InputStream.html#_top_">InputStream</a> in)
</pre>
<dl>
  <dd> Creates an input stream filter built on top of the specified 
 input stream.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> in - the underlying input stream.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<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 value 
 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>FilterInputStream</code> 
 calls the <code>read</code> method of its underlying input stream 
 and returns whatever value that method returns.
<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>
    <dt> <b>See Also:</b>
    <dd> <a href="#in">in</a>
  </dl></dd>
</dl>
<a name="read(byte[])"><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 b[]) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads up to <code>byte.length</code> bytes of data from this 
 input stream into an array of bytes. This method blocks until some 
 input is available. 
 <p>
 The <code>read</code> method of <code>FilterInputStream</code> 
 calls the <code>read</code> method of three arguments with the 
 arguments <code>b</code>, <code>0</code>, and 
 <code>b.length</code>, and returns whatever value that method returns.
 <p>
 Note that this method does not call the one-argument 
 <code>read</code> method of its underlying stream with the single 
 argument <code>b</code>. Subclasses of 
 <code>FilterInputStream</code> do not need to override this method 
 if they have overridden the three-argument <code>read</code> method.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the buffer into which the data is read.
    <dt> <b>Returns:</b>
    <dd> the total number of bytes read into the buffer, or
             <code>-1</code> if there is no more data because the end of
             the stream has been 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(byte[])">read</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="#read(byte[], int, int)">read</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 b[],
                 int off,
                 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 some input is 
 available. 
 <p>
 The <code>read</code> method of <code>FilterInputStream</code> 
 calls the <code>read</code> method of its underlying input stream 
 with the same arguments and returns whatever value that method returns.
<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>Returns:</b>
    <dd> the total number of bytes read into the buffer, or
             <code>-1</code> if there is no more data because the end of
             the stream has been 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(byte[], int, int)">read</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="#in">in</a>
  </dl></dd>
</dl>
<a name="skip(long)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="skip"><b>skip</b></a>
<pre>
 public long skip(long n) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Skips over and discards <code>n</code> bytes of data from the 
 input stream. The <code>skip</code> method may, for a variety of 
 reasons, end up skipping over some smaller number of bytes, 
 possibly <code>0</code>. The actual number of bytes skipped is 
 returned. 
 <p>
 The <code>skip </code>method of <code>FilterInputStream</code> 
 calls the <code>skip</code> method of its underlying input stream 
 with the same argument, and returns whatever value that method does.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> n - the number of bytes to be skipped.
    <dt> <b>Returns:</b>
    <dd> the actual number of bytes skipped.
    <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#skip(long)">skip</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
  </dl></dd>
</dl>
<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 that can be read from this input 
 stream without blocking. 
 <p>
 The <code>available</code> method of 
 <code>FilterInputStream</code> calls the <code>available</code> 
 method of its underlying input stream and returns whatever value 
 that method returns.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the number of bytes that can be read from the input stream
             without blocking.
    <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#available()">available</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="#in">in</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. The <code>close</code> method of 
 <code>FilterInputStream</code> calls the <code>close</code> method 
 of its underlying input stream.
<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>
    <dt> <b>See Also:</b>
    <dd> <a href="#in">in</a>
  </dl></dd>
</dl>
<a name="mark(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="mark"><b>mark</b></a>
<pre>
 public synchronized void mark(int readlimit)
</pre>
<dl>
  <dd> Marks the current position in this input stream. A subsequent 
 call to the <code>reset</code> method repositions this stream at 
 the last marked position so that subsequent reads re-read the same bytes.
 <p>
 The <code>readlimit</code> argument tells this input stream to 
 allow that many bytes to be read before the mark position gets 
 invalidated. 
 <p>
 The <code>mark</code> method of <code>FilterInputStream</code> 
 calls the <code>mark</code> method of its underlying input stream 
 with the <code>readlimit</code> argument.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> readlimit - the maximum limit of bytes that can be read before
                      the mark position becomes invalid.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#mark(int)">mark</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="#in">in</a>, <a href="#reset()">reset</a>
  </dl></dd>
</dl>
<a name="reset()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="reset"><b>reset</b></a>
<pre>
 public synchronized void reset() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Repositions this stream to the position at the time the 
 <code>mark</code> method was last called on this input stream. 
 <p>
 The <code>reset</code> method of <code>FilterInputStream</code> 
 calls the <code>reset</code> method of its underlying input stream.
 <p>
 Stream marks are intended to be used in
 situations where you need to read ahead a little to see what's in
 the stream. Often this is most easily done by invoking some
 general parser. If the stream is of the type handled by the
 parse, it just chugs along happily. If the stream is not of
 that type, the parser should toss an exception when it fails.
 If this happens within readlimit bytes, it allows the outer
 code to reset the stream and try another parser.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if the stream has not been marked or if the
               mark has been invalidated.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#reset()">reset</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="#in">in</a>, <a href="#mark(int)">mark</a>
  </dl></dd>
</dl>
<a name="markSupported()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="markSupported"><b>markSupported</b></a>
<pre>
 public boolean markSupported()
</pre>
<dl>
  <dd> Tests if this input stream supports the <code>mark</code> 
 and <code>reset</code> methods. The <code>markSupported</code> 
 method of <code>FilterInputStream</code> calls the 
 <code>markSupported</code> method of its underlying input stream 
 and returns whatever value that method returns.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> <code>true</code> if this stream type supports the
          <code>mark</code> and <code>reset</code> method;
          <code>false</code> otherwise.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.io.InputStream.html#markSupported()">markSupported</a> in class <a href="java.io.InputStream.html#_top_">InputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="#in">in</a>, <a href="java.io.InputStream.html#mark(int)">mark</a>, <a href="java.io.InputStream.html#reset()">reset</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.FileWriter.html#_top_">Previous</a>  <a href="java.io.FilterOutputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
