<!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.Reader
</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.RandomAccessFile.html#_top_">Previous</a>  <a href="java.io.SequenceInputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.io.Reader
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.io.Reader
</pre>
<hr>
<dl>
  <dt> public abstract class <b>Reader</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
Abstract class for reading character streams.  The only methods that a
 subclass must implement are read(char[], int, int) and close().  Most
 subclasses, however, will override some of the methods defined here in order
 to provide higher efficiency, additional functionality, or both.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.BufferedReader.html#_top_">BufferedReader</a>, <a href="java.io.LineNumberReader.html#_top_">LineNumberReader</a>, <a href="java.io.CharArrayReader.html#_top_">CharArrayReader</a>, <a href="java.io.InputStreamReader.html#_top_">InputStreamReader</a>, <a href="java.io.FileReader.html#_top_">FileReader</a>, <a href="java.io.FilterReader.html#_top_">FilterReader</a>, <a href="java.io.PushbackReader.html#_top_">PushbackReader</a>, <a href="java.io.PipedReader.html#_top_">PipedReader</a>, <a href="java.io.StringReader.html#_top_">StringReader</a>, <a href="java.io.Writer.html#_top_">Writer</a>
</dl>
<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="#lock"><b>lock</b></a>
  <dd>  The object used to synchronize operations on this 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="#Reader()"><b>Reader</b></a>()
  <dd>  Create a new character-stream reader whose critical sections will
 synchronize on the reader itself.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Reader(java.lang.Object)"><b>Reader</b></a>(Object)
  <dd>  Create a new character-stream reader whose critical sections will
 synchronize on the given object.
</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="#close()"><b>close</b></a>()
  <dd>  Close 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>  Mark the present position in the stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#markSupported()"><b>markSupported</b></a>()
  <dd>  Tell whether this stream supports the mark() operation.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#read()"><b>read</b></a>()
  <dd>  Read a single character.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#read(char[])"><b>read</b></a>(char[])
  <dd>  Read characters into an array.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#read(char[], int, int)"><b>read</b></a>(char[], int, int)
  <dd>  Read characters into a portion of an array.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#ready()"><b>ready</b></a>()
  <dd>  Tell whether this stream is ready to be read.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#reset()"><b>reset</b></a>()
  <dd>  Reset the 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>  Skip characters.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="lock"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>lock</b>
<pre>
 protected <a href="java.lang.Object.html#_top_">Object</a> lock
</pre>
<dl>
  <dd> The object used to synchronize operations on this stream.  For
 efficiency, a character-stream object may use an object other than
 itself to protect critical sections.  A subclass should therefore use
 the object in this field rather than <tt>this</tt> or a synchronized
 method.<p>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Reader"></a>
<a name="Reader()"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Reader</b>
<pre>
 protected Reader()
</pre>
<dl>
  <dd> Create a new character-stream reader whose critical sections will
 synchronize on the reader itself.
<p>
</dl>
<a name="Reader(java.lang.Object)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Reader</b>
<pre>
 protected Reader(<a href="java.lang.Object.html#_top_">Object</a> lock)
</pre>
<dl>
  <dd> Create a new character-stream reader whose critical sections will
 synchronize on the given object.
<p>
</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> Read a single character.  This method will block until a character is
 available, an I/O error occurs, or the end of the stream is reached.
 <p> Subclasses that intend to support efficient single-character input
 should override this method.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> The character read, as an integer in the range 0 to 16383
             (<tt>0x00-0xffff</tt>), or -1 if 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
  </dl></dd>
</dl>
<a name="read(char[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="read"><b>read</b></a>
<pre>
 public int read(char cbuf[]) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Read characters into an array.  This method will block until some input
 is available, an I/O error occurs, or the end of the stream is reached.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> cbuf - Destination buffer
    <dt> <b>Returns:</b>
    <dd> The number of bytes read, or -1 if 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
  </dl></dd>
</dl>
<a name="read(char[], int, int)"><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(char cbuf[],
                          int off,
                          int len) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Read characters into a portion of an array.  This method will block
 until some input is available, an I/O error occurs, or the end of the
 stream is reached.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> cbuf - Destination buffer
    <dd> off - Offset at which to start storing characters
    <dd> len - Maximum number of characters to read
    <dt> <b>Returns:</b>
    <dd> The number of characters read, or -1 if 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
  </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> Skip characters.  This method will block until some characters are
 available, an I/O error occurs, or the end of the stream is reached.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> n - The number of characters to skip
    <dt> <b>Returns:</b>
    <dd> The number of characters actually 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="ready()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="ready"><b>ready</b></a>
<pre>
 public boolean ready() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Tell whether this stream is ready to be read.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> True if the next read() is guaranteed not to block for input,
 false otherwise.  Note that returning false does not guarantee that the
 next read will block.
    <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="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> Tell whether this stream supports the mark() operation.
<p>
</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 void mark(int readAheadLimit) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Mark the present position in the stream.  Subsequent calls to reset()
 will attempt to reposition the stream to this point.  Not all
 character-input streams support the mark() operation.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> readAheadLimit - Limit on the number of characters that may be
                         read while still preserving the mark.  After
                         reading this many characters, attempting to
                         reset the stream may fail.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> If the stream does not support mark(),
                          or if some other I/O error occurs
  </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 void reset() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reset the stream.  If the stream has been marked, then attempt to
 reposition it at the mark.  If the stream has not been marked, then
 attempt to reset it in some way appropriate to the particular stream,
 for example by repositioning it to its starting point.  Not all
 character-input streams support the reset() operation, and some support
 reset() without supporting mark().
<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,
                          or if the stream does not support reset(),
                          or if some other 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 abstract void close() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Close the stream.  Once a stream has been closed, further read(),
 ready(), mark(), or reset() invocations will throw an IOException.
 Closing a previously-closed stream, however, has no effect.
<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>
<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.RandomAccessFile.html#_top_">Previous</a>  <a href="java.io.SequenceInputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
