<!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.InputStream
</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.FilterWriter.html#_top_">Previous</a>  <a href="java.io.InputStreamReader.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.io.InputStream
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.io.InputStream
</pre>
<hr>
<dl>
  <dt> public abstract class <b>InputStream</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
This abstract class is the superclass of all classes representing
 an input stream of bytes.
 <p>
 Applications that need to define a subclass of
 <code>InputStream</code> must always provide a method that returns
 the next byte of input.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.BufferedInputStream.html#_top_">BufferedInputStream</a>, <a href="java.io.ByteArrayInputStream.html#_top_">ByteArrayInputStream</a>, <a href="java.io.DataInputStream.html#_top_">DataInputStream</a>, <a href="java.io.FilterInputStream.html#_top_">FilterInputStream</a>, <a href="#read()">read</a>, <a href="java.io.OutputStream.html#_top_">OutputStream</a>, <a href="java.io.PushbackInputStream.html#_top_">PushbackInputStream</a>
</dl>
<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="#InputStream()"><b>InputStream</b></a>()
  <dd> 
</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>b.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 this
 input stream.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="InputStream"></a>
<a name="InputStream()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>InputStream</b>
<pre>
 public InputStream()
</pre>
<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 abstract 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>
 A subclass must provide an implementation of this method.
<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.
  </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>b.length</code> bytes of data from this input
 stream into an array of bytes.
 <p>
 The <code>read</code> method of <code>InputStream</code> calls
 the <code>read</code> method of three arguments with the arguments
 <code>b</code>, <code>0</code>, and <code>b.length</code>.
<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> is 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>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. If the argument <code>b</code> is <code>null</code>, a
 <code>NullPointerException</code> is thrown.
 <p>
 The <code>read</code> method of <code>InputStream</code> reads a
 single byte at a time using the read method of zero arguments to
 fill in the array. Subclasses are encouraged to provide a more
 efficient implementation of this method.
<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>See Also:</b>
    <dd> <a href="#read()">read</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 this
 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>InputStream</code> creates
 a byte array of length <code>n</code> and then reads into it until
 <code>n</code> bytes have been read or the end of the stream has
 been reached. Subclasses are encouraged to provide a more
 efficient implementation of this method.
<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.
  </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. The available method of
 <code>InputStream</code> returns <code>0</code>. This method
 <B>should</B> be overridden by subclasses.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the number of bytes that can be read from this input stream
             without blocking.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
  </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>InputStream</code> does nothing.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
  </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> arguments 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>InputStream</code> does nothing.
<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>See Also:</b>
    <dd> <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>InputStream</code> throws
 an <code>IOException</code>, because input streams, by default, do
 not support <code>mark</code> and <code>reset</code>.
 <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
 parser, it just chugs along happily. If the stream is not of
 that type, the parser should toss an exception when it fails,
 which, if it happens within readlimit bytes, 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 this stream has not been marked or if the
               mark has been invalidated.
    <dt> <b>See Also:</b>
    <dd> <a href="#mark(int)">mark</a>, <a href="java.io.IOException.html#_top_">IOException</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>InputStream</code> returns <code>false</code>.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> <code>true</code> if this true type supports the mark and reset
          method; <code>false</code> otherwise.
    <dt> <b>See Also:</b>
    <dd> <a href="#mark(int)">mark</a>, <a href="#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.FilterWriter.html#_top_">Previous</a>  <a href="java.io.InputStreamReader.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
