<!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.DataInputStream
</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.CharArrayWriter.html#_top_">Previous</a>  <a href="java.io.DataOutputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.io.DataInputStream
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.io.InputStream.html#_top_">java.io.InputStream</a>
           |
           +----<a href="java.io.FilterInputStream.html#_top_">java.io.FilterInputStream</a>
                   |
                   +----java.io.DataInputStream
</pre>
<hr>
<dl>
  <dt> public class <b>DataInputStream</b>
  <dt> extends <a href="java.io.FilterInputStream.html#_top_">FilterInputStream</a>
  <dt> implements <a href="java.io.DataInput.html#_top_">DataInput</a>
</dl>
A data input stream lets an application read primitive Java data 
 types from an underlying input stream in a machine-independent 
 way. An application uses a data output stream to write data that 
 can later be read by a data input stream. 
 <p>
 Data input streams and data output streams represent Unicode 
 strings in a format that is a slight modification of UTF-8. (For 
 more information, see X/Open Company Ltd., "File System Safe 
 UCS Transformation Format (FSS_UTF)", X/Open Preliminary 
 Specification, Document Number: P316. This information also 
 appears in ISO/IEC 10646, Annex P.) 
 <p>
 All characters in the range <code>'&#92;u0001'</code> to 
 <code>'&#92;u007F'</code> are represented by a single byte:
 <center><table border="3">
   <tr><td><i>0</i></td>  <td>bits 0-7</td></tr>
 </table></center>
 <p>
 The null character <code>'&#92;u0000'</code> and characters in the 
 range <code>'&#92;u0080'</code> to <code>'&#92;u07FF'</code> are 
 represented by a pair of bytes:
 <center><table border="3">
   <tr><td>1</td>  <td>1</td>  <td>0</td>  <td>bits 6-10</td></tr>
   <tr><td>1</td>  <td>0</td>  <td colspan=2>bits 0-5</td></tr>
 </table></center><br>
 Characters in the range <code>'&#92;u0800'</code> to 
 <code>'&#92;uFFFF'</code> are represented by three bytes:
 <center><table border="3">
   <tr><td>1</td>  <td>1</td>  <td>1</td>  <td>0</td>  <td>bits 12-15</td</tr>
   <tr><td>1</td>  <td>0</td>  <td colspan=3>bits 6-11</td></tr>
   <tr><td>1</td>  <td>0</td>  <td colspan=3>bits 0-5</td></tr>
 </table></center>
 <p>
 The two differences between this format and the 
 "standard" UTF-8 format are the following: 
 <ul>
 <li>The null byte <code>'&#92;u0000'</code> is encoded in 2-byte format 
     rather than 1-byte, so that the encoded strings never have 
     embedded nulls. 
 <li>Only the 1-byte, 2-byte, and 3-byte formats are used. 
 </ul>
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.DataOutputStream.html#_top_">DataOutputStream</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="#DataInputStream(java.io.InputStream)"><b>DataInputStream</b></a>(InputStream)
  <dd>  Creates a new data input stream to read data from 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="#read(byte[])"><b>read</b></a>(byte[])
  <dd>  Reads up to <code>byte.length</code> bytes of data from this data 
 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 data input 
 stream into an array of bytes.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readBoolean()"><b>readBoolean</b></a>()
  <dd>  Reads a <code>boolean</code> from this data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readByte()"><b>readByte</b></a>()
  <dd>  Reads a signed 8-bit value from this data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readChar()"><b>readChar</b></a>()
  <dd>  Reads a Unicode character from this data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readDouble()"><b>readDouble</b></a>()
  <dd>  Reads a <code>double</code> from this data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readFloat()"><b>readFloat</b></a>()
  <dd>  Reads a <code>float</code> from this data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readFully(byte[])"><b>readFully</b></a>(byte[])
  <dd>  Reads <code>b.length</code> bytes from this data input stream 
 into the byte array.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readFully(byte[], int, int)"><b>readFully</b></a>(byte[], int, int)
  <dd>  Reads exactly <code>len</code> bytes from this data input stream 
 into the byte array.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readInt()"><b>readInt</b></a>()
  <dd>  Reads a signed 32-bit integer from this data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readLine()"><b>readLine</b></a>()
  <dd>  Reads the next line of text from this data input stream.
<b>Deprecated.</b>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readLong()"><b>readLong</b></a>()
  <dd>  Reads a signed 64-bit integer from this data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readShort()"><b>readShort</b></a>()
  <dd>  Reads a signed 16-bit number from this data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readUnsignedByte()"><b>readUnsignedByte</b></a>()
  <dd>  Reads an unsigned 8-bit number from this data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readUnsignedShort()"><b>readUnsignedShort</b></a>()
  <dd>  Reads an unsigned 16-bit number from this data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readUTF()"><b>readUTF</b></a>()
  <dd>  Reads in a string that has been encoded using a modified UTF-8 
 format from this data input stream.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#readUTF(java.io.DataInput)"><b>readUTF</b></a>(DataInput)
  <dd>  Reads in a string from the specified data input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#skipBytes(int)"><b>skipBytes</b></a>(int)
  <dd>  Skips exactly <code>n</code> bytes of input in the underlying 
 input stream.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="DataInputStream"></a>
<a name="DataInputStream(java.io.InputStream)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>DataInputStream</b>
<pre>
 public DataInputStream(<a href="java.io.InputStream.html#_top_">InputStream</a> in)
</pre>
<dl>
  <dd> Creates a new data input stream to read data from the specified 
 input stream.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> in - the 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(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="read"><b>read</b></a>
<pre>
 public final 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 data 
 input stream into an array of bytes. This method blocks until some 
 input is available. 
 <p>
 The <code>read</code> method of <code>DataInputStream</code> 
 calls the <code>read</code> method of its underlying input stream 
 with the three arguments <code>b</code>, <code>0</code>, and 
 <code>b.length</code> and returns whatever value that method returns.
<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.FilterInputStream.html#read(byte[])">read</a> in class <a href="java.io.FilterInputStream.html#_top_">FilterInputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.FilterInputStream.html#in">in</a>, <a href="java.io.InputStream.html#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 final 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 data input 
 stream into an array of bytes. This method blocks until some input 
 is available. 
 <p>
 The <code>read</code> method of <code>DataInputStream</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.FilterInputStream.html#read(byte[], int, int)">read</a> in class <a href="java.io.FilterInputStream.html#_top_">FilterInputStream</a>
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.FilterInputStream.html#in">in</a>, <a href="java.io.InputStream.html#read(byte[], int, int)">read</a>
  </dl></dd>
</dl>
<a name="readFully(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readFully"><b>readFully</b></a>
<pre>
 public final void readFully(byte b[]) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads <code>b.length</code> bytes from this data input stream 
 into the byte array. This method reads repeatedly from the 
 underlying stream until all the bytes are read. This method blocks 
 until all the bytes are read, the end of the stream is detected, 
 or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> b - the buffer into which the data is read.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               reading all the bytes.
    <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="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="readFully(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readFully"><b>readFully</b></a>
<pre>
 public final void readFully(byte b[],
                             int off,
                             int len) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads exactly <code>len</code> bytes from this data input stream 
 into the byte array. This method reads repeatedly from the 
 underlying stream until all the bytes are read. This method blocks 
 until all the bytes are read, the end of the stream is detected, 
 or an exception is thrown.
<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 number of bytes to read.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               reading all the bytes.
    <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="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="skipBytes(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="skipBytes"><b>skipBytes</b></a>
<pre>
 public final int skipBytes(int n) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Skips exactly <code>n</code> bytes of input in the underlying 
 input stream. This method blocks until all the bytes are skipped, 
 the end of the stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> n - the number of bytes to be skipped.
    <dt> <b>Returns:</b>
    <dd> the number of bytes skipped, which is always <code>n</code>.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               skipping all the bytes.
    <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="readBoolean()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readBoolean"><b>readBoolean</b></a>
<pre>
 public final boolean readBoolean() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads a <code>boolean</code> from this data input stream. This 
 method reads a single byte from the underlying input stream. A 
 value of <code>0</code> represents <code>false</code>. Any other 
 value represents <code>true</code>. This method blocks until 
 either the byte is read, the end of the stream is detected, or an 
 exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the <code>boolean</code> value read.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream has reached the end.
    <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="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="readByte()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readByte"><b>readByte</b></a>
<pre>
 public final byte readByte() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads a signed 8-bit value from this data input stream. This 
 method reads a byte from the underlying input stream. If the byte 
 read is <code>b</code>, where 
 0&nbsp;&lt;=&nbsp;<code>b</code>&nbsp;&lt;=&nbsp;255, then the 
 result is:
 <ul><code>
     (byte)(b)
 </code></ul>
 <p>
 This method blocks until either the byte is read, the end of the 
 stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next byte of this input stream as a signed 8-bit
             <code>byte</code>.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream has reached the end.
    <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="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="readUnsignedByte()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readUnsignedByte"><b>readUnsignedByte</b></a>
<pre>
 public final int readUnsignedByte() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads an unsigned 8-bit number from this data input stream. This 
 method reads a byte from this data input stream's underlying input 
 stream and returns that byte. This method blocks until the byte is 
 read, the end of the stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next byte of this input stream, interpreted as an
             unsigned 8-bit number.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream has reached the end.
    <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="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="readShort()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readShort"><b>readShort</b></a>
<pre>
 public final short readShort() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads a signed 16-bit number from this data input stream. The 
 method reads two bytes from the underlying input stream. If the two
 bytes read, in order, are <code>b1</code> and <code>b2</code>, 
 where each of the two values is between <code>0</code> and 
 <code>255</code>, inclusive, then the result is equal to:
 <ul><code>
     (short)((b1 &lt;&lt; 8) | b2)
 </code></ul>
 <p>
 This method blocks until the two bytes are read, the end of the 
 stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next two bytes of this input stream, interpreted as a
             signed 16-bit number.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               reading two bytes.
    <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="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="readUnsignedShort()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readUnsignedShort"><b>readUnsignedShort</b></a>
<pre>
 public final int readUnsignedShort() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads an unsigned 16-bit number from this data input stream. This 
 method reads two bytes from the underlying input stream. If the 
 bytes read, in order, are <code>b1</code> and <code>b2</code>, 
 where <code>0&nbsp;&lt;=&nbsp;b1</code>, 
 <code>b2&nbsp;&lt;=&nbsp;255</code>, then the result is equal to:
 <ul><code>
     (b1 &lt;&lt; 8) | b2
 </code></ul>
 <p>
 This method blocks until the two bytes are read, the end of the 
 stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next two bytes of this input stream, interpreted as an
             unsigned 16-bit integer.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               reading two bytes.
    <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="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="readChar()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readChar"><b>readChar</b></a>
<pre>
 public final char readChar() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads a Unicode character from this data input stream. This 
 method reads two bytes from the underlying input stream. If the 
 bytes read, in order, are <code>b1</code> and <code>b2</code>, 
 where 0&nbsp;&lt;=&nbsp;<code>b1</code>, 
 <code>b1</code>&nbsp;&lt;=&nbsp;255, then the result is equal to:
 <ul><code>
     (char)((b1 &lt;&lt; 8) | b2)
 </code></ul>
 <p>
 This method blocks until either the two bytes are read, the end of 
 the stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next two bytes of this input stream as a Unicode
             character.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               reading two bytes.
    <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="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="readInt()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readInt"><b>readInt</b></a>
<pre>
 public final int readInt() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads a signed 32-bit integer from this data input stream. This 
 method reads four bytes from the underlying input stream. If the 
 bytes read, in order, are <code>b1</code>, <code>b2</code>, 
 <code>b3</code>, and <code>b4</code>, where 
 0&nbsp;&lt;=&nbsp;<code>b1</code>, <code>b2</code>, 
 <code>b3</code>, <code>b4</code>&nbsp;&lt;=&nbsp;255, then the 
 result is equal to:
 <ul><code>
     (b1 &lt;&lt; 24) | (b2 &lt;&lt; 16) + (b3 &lt;&lt; 8) +b4
 </code></ul>
 <p>
 This method blocks until the four bytes are read, the end of the 
 stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next four bytes of this input stream, interpreted as an
             <code>int</code>.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               reading four bytes.
    <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="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="readLong()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readLong"><b>readLong</b></a>
<pre>
 public final long readLong() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads a signed 64-bit integer from this data input stream. This 
 method reads eight bytes from the underlying input stream. If the 
 bytes read, in order, are <code>b1</code>, <code>b2</code>, 
 <code>b3</code>, <code>b4</code>, <code>b5</code>, 
 <code>b6</code>, <code>b7</code>, and <code>b8</code>, where 
 <ul><code>
     0 &lt;= b1, b2, b3, b4, b5, b6, b7, b8 &lt;= 255,
 </code></ul>
 <p>
 then the result is equal to:
 <p><blockquote><pre>
     ((long)b1 &lt;&lt; 56) + ((long)b2 &lt;&lt; 48) +
        ((long)b3 &lt;&lt; 40) + ((long)b4 &lt;&lt; 32) +
        ((long)b5 &lt;&lt; 24) + (b6 &lt;&lt; 16) +
        (b7 &lt;&lt; 8) + b8
 </pre></blockquote>
 <p>
 This method blocks until the eight bytes are read, the end of the 
 stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next eight bytes of this input stream, interpreted as a
             <code>long</code>.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               reading eight bytes.
    <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="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="readFloat()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readFloat"><b>readFloat</b></a>
<pre>
 public final float readFloat() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads a <code>float</code> from this data input stream. This 
 method reads an <code>int</code> value as if by the 
 <code>readInt</code> method and then converts that 
 <code>int</code> to a <code>float</code> using the 
 <code>intBitsToFloat</code> method in class <code>Float</code>. 
 This method blocks until the four bytes are read, the end of the 
 stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next four bytes of this input stream, interpreted as a
             <code>float</code>.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               reading four bytes.
    <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="#readInt()">readInt</a>, <a href="java.lang.Float.html#intBitsToFloat(int)">intBitsToFloat</a>
  </dl></dd>
</dl>
<a name="readDouble()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readDouble"><b>readDouble</b></a>
<pre>
 public final double readDouble() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads a <code>double</code> from this data input stream. This 
 method reads a <code>long</code> value as if by the 
 <code>readLong</code> method and then converts that 
 <code>long</code> to a <code>double</code> using the 
 <code>longBitsToDouble</code> method in class <code>Double</code>.
 <p>
 This method blocks until the eight bytes are read, the end of the 
 stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next eight bytes of this input stream, interpreted as a
             <code>double</code>.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               reading eight bytes.
    <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="#readLong()">readLong</a>, <a href="java.lang.Double.html#longBitsToDouble(long)">longBitsToDouble</a>
  </dl></dd>
</dl>
<a name="readLine()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readLine"><b>readLine</b></a>
<pre>
 public final <a href="java.lang.String.html#_top_">String</a> readLine() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
<dd><b> Note: readLine() is deprecated.</b>
<i>This method does not properly convert bytes to characters.
 As of JDK&nbsp;1.1, the preferred way to read lines of text is via the
 <code>BufferedReader.readLine()</code> method.  Programs that use the
 <code>DataInputStream</code> class to read lines can be converted to use
 the <code>BufferedReader</code> class by replacing code of the form
 <ul>
     <code>DataInputStream d =&nbsp;new&nbsp;DataInputStream(in);</code>
 </ul>
 with
 <ul>
     <code>BufferedReader d
          =&nbsp;new&nbsp;BufferedReader(new&nbsp;InputStreamReader(in));
      </code>
 </ul></i>
<p>
  <dd> Reads the next line of text from this data input stream. This 
 method successively reads bytes from the underlying input stream 
 until it reaches the end of a line of text. 
 <p>
 A line of text is terminated by a carriage return character 
 (<code>'&#92;r'</code>), a newline character (<code>'&#92;n'</code>), a 
 carriage return character immediately followed by a newline 
 character, or the end of the input stream. The line-terminating 
 character(s), if any, are not returned as part of the string that 
 is returned. 
 <p>
 This method blocks until a newline character is read, a carriage 
 return and the byte following it are read (to see if it is a 
 newline), the end of the stream is detected, or an exception is 
 thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the next line of text from this input stream, or
             <tt>null</tt> if no bytes are read before end-of-file 
             is 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="java.io.BufferedReader.html#readLine()">readLine</a>, <a href="java.io.FilterInputStream.html#in">in</a>
  </dl></dd>
</dl>
<a name="readUTF()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readUTF"><b>readUTF</b></a>
<pre>
 public final <a href="java.lang.String.html#_top_">String</a> readUTF() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads in a string that has been encoded using a modified UTF-8 
 format from this data input stream. This method calls 
 <code>readUTF(this)</code>.
 See <code>readUTF(java.io.DataInput)</code> for a more 
 complete description of the format. 
 <p>
 This method blocks until all the bytes are read, the end of the 
 stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a Unicode string.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if this input stream reaches the end before
               reading all the bytes.
    <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="#readUTF(java.io.DataInput)">readUTF</a>
  </dl></dd>
</dl>
<a name="readUTF(java.io.DataInput)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="readUTF"><b>readUTF</b></a>
<pre>
 public static final <a href="java.lang.String.html#_top_">String</a> readUTF(<a href="java.io.DataInput.html#_top_">DataInput</a> in) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Reads in a string from the specified data input stream. The 
 string has been encoded using a modified UTF-8 format. 
 <p>
 The first two bytes are read as if by 
 <code>readUnsignedShort</code>. This value gives the number of 
 following bytes that are in the encoded string, not
 the length of the resulting string. The following bytes are then 
 interpreted as bytes encoding characters in the UTF-8 format 
 and are converted into characters. 
 <p>
 This method blocks until all the bytes are read, the end of the 
 stream is detected, or an exception is thrown.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> in - a data input stream.
    <dt> <b>Returns:</b>
    <dd> a Unicode string.
    <dt> <b>Throws:</b> <a href="java.io.EOFException.html#_top_">EOFException</a>
    <dd> if the input stream reaches the end
               before all the bytes.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs.
    <dt> <b>Throws:</b> <a href="java.io.UTFDataFormatException.html#_top_">UTFDataFormatException</a>
    <dd> if the bytes do not represent a
               valid UTF-8 encoding of a Unicode string.
    <dt> <b>See Also:</b>
    <dd> <a href="#readUnsignedShort()">readUnsignedShort</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.CharArrayWriter.html#_top_">Previous</a>  <a href="java.io.DataOutputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
