<!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.StringBufferInputStream
</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.StreamTokenizer.html#_top_">Previous</a>  <a href="java.io.StringReader.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.io.StringBufferInputStream
</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.StringBufferInputStream
</pre>
<hr>
<dl>
  <dt> public class <b>StringBufferInputStream</b>
  <dt> extends <a href="java.io.InputStream.html#_top_">InputStream</a>
</dl>
<b> Note: StringBufferInputStream is deprecated.</b>
<i>This class does not properly convert characters into bytes.  As
             of JDK&nbsp;1.1, the preferred way to create a stream from a
             string is via the <code>StringReader</code> class.</i>
<p>
This class allows an application to create an input stream in 
 which the bytes read are supplied by the contents of a string. 
 Applications can also read bytes from a byte array by using a 
 <code>ByteArrayInputStream</code>. 
 <p>
 Only the low eight bits of each character in the string are used by
 this class.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.ByteArrayInputStream.html#_top_">ByteArrayInputStream</a>, <a href="java.io.StringReader.html#_top_">StringReader</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="#buffer"><b>buffer</b></a>
  <dd>  The string from which bytes are read.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#count"><b>count</b></a>
  <dd>  The number of valid characters in the input stream buffer.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#pos"><b>pos</b></a>
  <dd>  The index of the next character to read from the input stream buffer.
</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="#StringBufferInputStream(java.lang.String)"><b>StringBufferInputStream</b></a>(String)
  <dd>  Creates a string input stream to read data from the specified string.
</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 the input 
 stream without blocking.
  <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.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#reset()"><b>reset</b></a>()
  <dd>  Resets the input stream to begin reading from the first character 
 of this input stream's underlying buffer.
  <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 <code>n</code> bytes of input from this input stream.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="buffer"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>buffer</b>
<pre>
 protected <a href="java.lang.String.html#_top_">String</a> buffer
</pre>
<dl>
  <dd> The string from which bytes are read.<p>
</dl>
<a name="pos"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>pos</b>
<pre>
 protected int pos
</pre>
<dl>
  <dd> The index of the next character to read from the input stream buffer.<p>
  <dd><dl> 
    <dt> <b>See Also:</b>
    <dd> <a href="#buffer">buffer</a>
  </dl></dd>
</dl>
<a name="count"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>count</b>
<pre>
 protected int count
</pre>
<dl>
  <dd> The number of valid characters in the input stream buffer.<p>
  <dd><dl> 
    <dt> <b>See Also:</b>
    <dd> <a href="#buffer">buffer</a>
  </dl></dd>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="StringBufferInputStream"></a>
<a name="StringBufferInputStream(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>StringBufferInputStream</b>
<pre>
 public StringBufferInputStream(<a href="java.lang.String.html#_top_">String</a> s)
</pre>
<dl>
  <dd> Creates a string input stream to read data from the specified string.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> s - the underlying input buffer.
  </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 synchronized int read()
</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. 
 <p>
 The <code>read</code> method of 
 <code>StringBufferInputStream</code> cannot block. It returns the 
 low eight bits of the next character in this input stream's buffer.
<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>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 synchronized int read(byte b[],
                              int off,
                              int len)
</pre>
<dl>
  <dd> Reads up to <code>len</code> bytes of data from this input stream 
 into an array of bytes. 
 <p>
 The <code>read</code> method of 
 <code>StringBufferInputStream</code> cannot block. It copies the 
 low eight bits from the characters in this input stream's buffer into 
 the byte array argument.
<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>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="skip(long)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="skip"><b>skip</b></a>
<pre>
 public synchronized long skip(long n)
</pre>
<dl>
  <dd> Skips <code>n</code> bytes of input from this input stream. Fewer 
 bytes might be skipped if the end of the input stream is reached.
<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>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 synchronized int available()
</pre>
<dl>
  <dd> Returns the number of bytes that can be read from the input 
 stream without blocking.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the value of <code>count&nbsp;-&nbsp;pos</code>, which is the
             number of bytes remaining to be read from the input buffer.
    <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="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()
</pre>
<dl>
  <dd> Resets the input stream to begin reading from the first character 
 of this input stream's underlying buffer.
<p>
  <dd><dl>
    <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>
  </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.StreamTokenizer.html#_top_">Previous</a>  <a href="java.io.StringReader.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
