0N/A/*
2362N/A * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.io;
0N/A
0N/A/**
0N/A * The <code>DataInput</code> interface provides
0N/A * for reading bytes from a binary stream and
0N/A * reconstructing from them data in any of
0N/A * the Java primitive types. There is also
0N/A * a
0N/A * facility for reconstructing a <code>String</code>
0N/A * from data in
0N/A * <a href="#modified-utf-8">modified UTF-8</a>
0N/A * format.
0N/A * <p>
0N/A * It is generally true of all the reading
0N/A * routines in this interface that if end of
0N/A * file is reached before the desired number
0N/A * of bytes has been read, an <code>EOFException</code>
0N/A * (which is a kind of <code>IOException</code>)
0N/A * is thrown. If any byte cannot be read for
0N/A * any reason other than end of file, an <code>IOException</code>
0N/A * other than <code>EOFException</code> is
0N/A * thrown. In particular, an <code>IOException</code>
0N/A * may be thrown if the input stream has been
0N/A * closed.
0N/A *
0N/A * <h4><a name="modified-utf-8">Modified UTF-8</a></h4>
0N/A * <p>
0N/A * Implementations of the DataInput and DataOutput interfaces represent
0N/A * Unicode strings in a format that is a slight modification of UTF-8.
0N/A * (For information regarding the standard UTF-8 format, see section
0N/A * <i>3.9 Unicode Encoding Forms</i> of <i>The Unicode Standard, Version
0N/A * 4.0</i>).
0N/A * Note that in the following tables, the most significant bit appears in the
0N/A * far left-hand column.
0N/A * <p>
0N/A * All characters in the range <code>'&#92;u0001'</code> to
0N/A * <code>'&#92;u007F'</code> are represented by a single byte:
0N/A *
0N/A * <blockquote>
0N/A * <table border="1" cellspacing="0" cellpadding="8" width="50%"
0N/A * summary="Bit values and bytes">
0N/A * <tr>
0N/A * <td></td>
0N/A * <th id="bit">Bit Values</th>
0N/A * </tr>
0N/A * <tr>
0N/A * <th id="byte1">Byte 1</th>
0N/A * <td>
0N/A * <table border="1" cellspacing="0" width="100%">
0N/A * <tr>
0N/A * <td width="12%"><center>0</center>
0N/A * <td colspan="7"><center>bits 6-0</center>
0N/A * </tr>
0N/A * </table>
0N/A * </td>
0N/A * </tr>
0N/A * </table>
0N/A * </blockquote>
0N/A *
0N/A * <p>
0N/A * The null character <code>'&#92;u0000'</code> and characters in the
0N/A * range <code>'&#92;u0080'</code> to <code>'&#92;u07FF'</code> are
0N/A * represented by a pair of bytes:
0N/A *
0N/A * <blockquote>
0N/A * <table border="1" cellspacing="0" cellpadding="8" width="50%"
0N/A * summary="Bit values and bytes">
0N/A * <tr>
0N/A * <td></td>
0N/A * <th id="bit">Bit Values</th>
0N/A * </tr>
0N/A * <tr>
0N/A * <th id="byte1">Byte 1</th>
0N/A * <td>
0N/A * <table border="1" cellspacing="0" width="100%">
0N/A * <tr>
0N/A * <td width="12%"><center>1</center>
0N/A * <td width="13%"><center>1</center>
0N/A * <td width="12%"><center>0</center>
0N/A * <td colspan="5"><center>bits 10-6</center>
0N/A * </tr>
0N/A * </table>
0N/A * </td>
0N/A * </tr>
0N/A * <tr>
0N/A * <th id="byte2">Byte 2</th>
0N/A * <td>
0N/A * <table border="1" cellspacing="0" width="100%">
0N/A * <tr>
0N/A * <td width="12%"><center>1</center>
0N/A * <td width="13%"><center>0</center>
0N/A * <td colspan="6"><center>bits 5-0</center>
0N/A * </tr>
0N/A * </table>
0N/A * </td>
0N/A * </tr>
0N/A * </table>
0N/A * </blockquote>
0N/A *
0N/A * <br>
0N/A * <code>char</code> values in the range <code>'&#92;u0800'</code> to
0N/A * <code>'&#92;uFFFF'</code> are represented by three bytes:
0N/A *
0N/A * <blockquote>
0N/A * <table border="1" cellspacing="0" cellpadding="8" width="50%"
0N/A * summary="Bit values and bytes">
0N/A * <tr>
0N/A * <td></td>
0N/A * <th id="bit">Bit Values</th>
0N/A * </tr>
0N/A * <tr>
0N/A * <th id="byte1">Byte 1</th>
0N/A * <td>
0N/A * <table border="1" cellspacing="0" width="100%">
0N/A * <tr>
0N/A * <td width="12%"><center>1</center>
0N/A * <td width="13%"><center>1</center>
0N/A * <td width="12%"><center>1</center>
0N/A * <td width="13%"><center>0</center>
0N/A * <td colspan="4"><center>bits 15-12</center>
0N/A * </tr>
0N/A * </table>
0N/A * </td>
0N/A * </tr>
0N/A * <tr>
0N/A * <th id="byte2">Byte 2</th>
0N/A * <td>
0N/A * <table border="1" cellspacing="0" width="100%">
0N/A * <tr>
0N/A * <td width="12%"><center>1</center>
0N/A * <td width="13%"><center>0</center>
0N/A * <td colspan="6"><center>bits 11-6</center>
0N/A * </tr>
0N/A * </table>
0N/A * </td>
0N/A * </tr>
0N/A * <tr>
0N/A * <th id="byte3">Byte 3</th>
0N/A * <td>
0N/A * <table border="1" cellspacing="0" width="100%">
0N/A * <tr>
0N/A * <td width="12%"><center>1</center>
0N/A * <td width="13%"><center>0</center>
0N/A * <td colspan="6"><center>bits 5-0</center>
0N/A * </tr>
0N/A * </table>
0N/A * </td>
0N/A * </tr>
0N/A * </table>
0N/A * </blockquote>
0N/A *
0N/A * <p>
0N/A * The differences between this format and the
0N/A * standard UTF-8 format are the following:
0N/A * <ul>
0N/A * <li>The null byte <code>'&#92;u0000'</code> is encoded in 2-byte format
0N/A * rather than 1-byte, so that the encoded strings never have
0N/A * embedded nulls.
0N/A * <li>Only the 1-byte, 2-byte, and 3-byte formats are used.
0N/A * <li><a href="../lang/Character.html#unicode">Supplementary characters</a>
0N/A * are represented in the form of surrogate pairs.
0N/A * </ul>
0N/A * @author Frank Yellin
0N/A * @see java.io.DataInputStream
0N/A * @see java.io.DataOutput
0N/A * @since JDK1.0
0N/A */
0N/Apublic
0N/Ainterface DataInput {
0N/A /**
0N/A * Reads some bytes from an input
0N/A * stream and stores them into the buffer
0N/A * array <code>b</code>. The number of bytes
0N/A * read is equal
0N/A * to the length of <code>b</code>.
0N/A * <p>
0N/A * This method blocks until one of the
0N/A * following conditions occurs:<p>
0N/A * <ul>
0N/A * <li><code>b.length</code>
0N/A * bytes of input data are available, in which
0N/A * case a normal return is made.
0N/A *
0N/A * <li>End of
0N/A * file is detected, in which case an <code>EOFException</code>
0N/A * is thrown.
0N/A *
0N/A * <li>An I/O error occurs, in
0N/A * which case an <code>IOException</code> other
0N/A * than <code>EOFException</code> is thrown.
0N/A * </ul>
0N/A * <p>
0N/A * If <code>b</code> is <code>null</code>,
0N/A * a <code>NullPointerException</code> is thrown.
0N/A * If <code>b.length</code> is zero, then
0N/A * no bytes are read. Otherwise, the first
0N/A * byte read is stored into element <code>b[0]</code>,
0N/A * the next one into <code>b[1]</code>, and
0N/A * so on.
0N/A * If an exception is thrown from
0N/A * this method, then it may be that some but
0N/A * not all bytes of <code>b</code> have been
0N/A * updated with data from the input stream.
0N/A *
0N/A * @param b the buffer into which the data is read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A void readFully(byte b[]) throws IOException;
0N/A
0N/A /**
0N/A *
0N/A * Reads <code>len</code>
0N/A * bytes from
0N/A * an input stream.
0N/A * <p>
0N/A * This method
0N/A * blocks until one of the following conditions
0N/A * occurs:<p>
0N/A * <ul>
0N/A * <li><code>len</code> bytes
0N/A * of input data are available, in which case
0N/A * a normal return is made.
0N/A *
0N/A * <li>End of file
0N/A * is detected, in which case an <code>EOFException</code>
0N/A * is thrown.
0N/A *
0N/A * <li>An I/O error occurs, in
0N/A * which case an <code>IOException</code> other
0N/A * than <code>EOFException</code> is thrown.
0N/A * </ul>
0N/A * <p>
0N/A * If <code>b</code> is <code>null</code>,
0N/A * a <code>NullPointerException</code> is thrown.
0N/A * If <code>off</code> is negative, or <code>len</code>
0N/A * is negative, or <code>off+len</code> is
0N/A * greater than the length of the array <code>b</code>,
0N/A * then an <code>IndexOutOfBoundsException</code>
0N/A * is thrown.
0N/A * If <code>len</code> is zero,
0N/A * then no bytes are read. Otherwise, the first
0N/A * byte read is stored into element <code>b[off]</code>,
0N/A * the next one into <code>b[off+1]</code>,
0N/A * and so on. The number of bytes read is,
0N/A * at most, equal to <code>len</code>.
0N/A *
0N/A * @param b the buffer into which the data is read.
0N/A * @param off an int specifying the offset into the data.
0N/A * @param len an int specifying the number of bytes to read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A void readFully(byte b[], int off, int len) throws IOException;
0N/A
0N/A /**
0N/A * Makes an attempt to skip over
0N/A * <code>n</code> bytes
0N/A * of data from the input
0N/A * stream, discarding the skipped bytes. However,
0N/A * it may skip
0N/A * over some smaller number of
0N/A * bytes, possibly zero. This may result from
0N/A * any of a
0N/A * number of conditions; reaching
0N/A * end of file before <code>n</code> bytes
0N/A * have been skipped is
0N/A * only one possibility.
0N/A * This method never throws an <code>EOFException</code>.
0N/A * The actual
0N/A * number of bytes skipped is returned.
0N/A *
0N/A * @param n the number of bytes to be skipped.
0N/A * @return the number of bytes actually skipped.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A int skipBytes(int n) throws IOException;
0N/A
0N/A /**
0N/A * Reads one input byte and returns
0N/A * <code>true</code> if that byte is nonzero,
0N/A * <code>false</code> if that byte is zero.
0N/A * This method is suitable for reading
0N/A * the byte written by the <code>writeBoolean</code>
0N/A * method of interface <code>DataOutput</code>.
0N/A *
0N/A * @return the <code>boolean</code> value read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A boolean readBoolean() throws IOException;
0N/A
0N/A /**
0N/A * Reads and returns one input byte.
0N/A * The byte is treated as a signed value in
0N/A * the range <code>-128</code> through <code>127</code>,
0N/A * inclusive.
0N/A * This method is suitable for
0N/A * reading the byte written by the <code>writeByte</code>
0N/A * method of interface <code>DataOutput</code>.
0N/A *
0N/A * @return the 8-bit value read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A byte readByte() throws IOException;
0N/A
0N/A /**
0N/A * Reads one input byte, zero-extends
0N/A * it to type <code>int</code>, and returns
0N/A * the result, which is therefore in the range
0N/A * <code>0</code>
0N/A * through <code>255</code>.
0N/A * This method is suitable for reading
0N/A * the byte written by the <code>writeByte</code>
0N/A * method of interface <code>DataOutput</code>
0N/A * if the argument to <code>writeByte</code>
0N/A * was intended to be a value in the range
0N/A * <code>0</code> through <code>255</code>.
0N/A *
0N/A * @return the unsigned 8-bit value read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A int readUnsignedByte() throws IOException;
0N/A
0N/A /**
0N/A * Reads two input bytes and returns
0N/A * a <code>short</code> value. Let <code>a</code>
0N/A * be the first byte read and <code>b</code>
0N/A * be the second byte. The value
0N/A * returned
0N/A * is:
0N/A * <p><pre><code>(short)((a &lt;&lt; 8) | (b &amp; 0xff))
0N/A * </code></pre>
0N/A * This method
0N/A * is suitable for reading the bytes written
0N/A * by the <code>writeShort</code> method of
0N/A * interface <code>DataOutput</code>.
0N/A *
0N/A * @return the 16-bit value read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A short readShort() throws IOException;
0N/A
0N/A /**
0N/A * Reads two input bytes and returns
0N/A * an <code>int</code> value in the range <code>0</code>
0N/A * through <code>65535</code>. Let <code>a</code>
0N/A * be the first byte read and
0N/A * <code>b</code>
0N/A * be the second byte. The value returned is:
0N/A * <p><pre><code>(((a &amp; 0xff) &lt;&lt; 8) | (b &amp; 0xff))
0N/A * </code></pre>
0N/A * This method is suitable for reading the bytes
0N/A * written by the <code>writeShort</code> method
0N/A * of interface <code>DataOutput</code> if
0N/A * the argument to <code>writeShort</code>
0N/A * was intended to be a value in the range
0N/A * <code>0</code> through <code>65535</code>.
0N/A *
0N/A * @return the unsigned 16-bit value read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A int readUnsignedShort() throws IOException;
0N/A
0N/A /**
0N/A * Reads two input bytes and returns a <code>char</code> value.
0N/A * Let <code>a</code>
0N/A * be the first byte read and <code>b</code>
0N/A * be the second byte. The value
0N/A * returned is:
0N/A * <p><pre><code>(char)((a &lt;&lt; 8) | (b &amp; 0xff))
0N/A * </code></pre>
0N/A * This method
0N/A * is suitable for reading bytes written by
0N/A * the <code>writeChar</code> method of interface
0N/A * <code>DataOutput</code>.
0N/A *
0N/A * @return the <code>char</code> value read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A char readChar() throws IOException;
0N/A
0N/A /**
0N/A * Reads four input bytes and returns an
0N/A * <code>int</code> value. Let <code>a-d</code>
0N/A * be the first through fourth bytes read. The value returned is:
0N/A * <p><pre>
0N/A * <code>
0N/A * (((a &amp; 0xff) &lt;&lt; 24) | ((b &amp; 0xff) &lt;&lt; 16) |
0N/A * &#32;((c &amp; 0xff) &lt;&lt; 8) | (d &amp; 0xff))
0N/A * </code></pre>
0N/A * This method is suitable
0N/A * for reading bytes written by the <code>writeInt</code>
0N/A * method of interface <code>DataOutput</code>.
0N/A *
0N/A * @return the <code>int</code> value read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A int readInt() throws IOException;
0N/A
0N/A /**
0N/A * Reads eight input bytes and returns
0N/A * a <code>long</code> value. Let <code>a-h</code>
0N/A * be the first through eighth bytes read.
0N/A * The value returned is:
0N/A * <p><pre> <code>
0N/A * (((long)(a &amp; 0xff) &lt;&lt; 56) |
0N/A * ((long)(b &amp; 0xff) &lt;&lt; 48) |
0N/A * ((long)(c &amp; 0xff) &lt;&lt; 40) |
0N/A * ((long)(d &amp; 0xff) &lt;&lt; 32) |
0N/A * ((long)(e &amp; 0xff) &lt;&lt; 24) |
0N/A * ((long)(f &amp; 0xff) &lt;&lt; 16) |
0N/A * ((long)(g &amp; 0xff) &lt;&lt; 8) |
0N/A * ((long)(h &amp; 0xff)))
0N/A * </code></pre>
0N/A * <p>
0N/A * This method is suitable
0N/A * for reading bytes written by the <code>writeLong</code>
0N/A * method of interface <code>DataOutput</code>.
0N/A *
0N/A * @return the <code>long</code> value read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A long readLong() throws IOException;
0N/A
0N/A /**
0N/A * Reads four input bytes and returns
0N/A * a <code>float</code> value. It does this
0N/A * by first constructing an <code>int</code>
0N/A * value in exactly the manner
0N/A * of the <code>readInt</code>
0N/A * method, then converting this <code>int</code>
0N/A * value to a <code>float</code> in
0N/A * exactly the manner of the method <code>Float.intBitsToFloat</code>.
0N/A * This method is suitable for reading
0N/A * bytes written by the <code>writeFloat</code>
0N/A * method of interface <code>DataOutput</code>.
0N/A *
0N/A * @return the <code>float</code> value read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A float readFloat() throws IOException;
0N/A
0N/A /**
0N/A * Reads eight input bytes and returns
0N/A * a <code>double</code> value. It does this
0N/A * by first constructing a <code>long</code>
0N/A * value in exactly the manner
0N/A * of the <code>readlong</code>
0N/A * method, then converting this <code>long</code>
0N/A * value to a <code>double</code> in exactly
0N/A * the manner of the method <code>Double.longBitsToDouble</code>.
0N/A * This method is suitable for reading
0N/A * bytes written by the <code>writeDouble</code>
0N/A * method of interface <code>DataOutput</code>.
0N/A *
0N/A * @return the <code>double</code> value read.
0N/A * @exception EOFException if this stream reaches the end before reading
0N/A * all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A double readDouble() throws IOException;
0N/A
0N/A /**
0N/A * Reads the next line of text from the input stream.
0N/A * It reads successive bytes, converting
0N/A * each byte separately into a character,
0N/A * until it encounters a line terminator or
0N/A * end of
0N/A * file; the characters read are then
0N/A * returned as a <code>String</code>. Note
0N/A * that because this
0N/A * method processes bytes,
0N/A * it does not support input of the full Unicode
0N/A * character set.
0N/A * <p>
0N/A * If end of file is encountered
0N/A * before even one byte can be read, then <code>null</code>
0N/A * is returned. Otherwise, each byte that is
0N/A * read is converted to type <code>char</code>
0N/A * by zero-extension. If the character <code>'\n'</code>
0N/A * is encountered, it is discarded and reading
0N/A * ceases. If the character <code>'\r'</code>
0N/A * is encountered, it is discarded and, if
0N/A * the following byte converts &#32;to the
0N/A * character <code>'\n'</code>, then that is
0N/A * discarded also; reading then ceases. If
0N/A * end of file is encountered before either
0N/A * of the characters <code>'\n'</code> and
0N/A * <code>'\r'</code> is encountered, reading
0N/A * ceases. Once reading has ceased, a <code>String</code>
0N/A * is returned that contains all the characters
0N/A * read and not discarded, taken in order.
0N/A * Note that every character in this string
0N/A * will have a value less than <code>&#92;u0100</code>,
0N/A * that is, <code>(char)256</code>.
0N/A *
0N/A * @return the next line of text from the input stream,
0N/A * or <CODE>null</CODE> if the end of file is
0N/A * encountered before a byte can be read.
0N/A * @exception IOException if an I/O error occurs.
0N/A */
0N/A String readLine() throws IOException;
0N/A
0N/A /**
0N/A * Reads in a string that has been encoded using a
0N/A * <a href="#modified-utf-8">modified UTF-8</a>
0N/A * format.
0N/A * The general contract of <code>readUTF</code>
0N/A * is that it reads a representation of a Unicode
0N/A * character string encoded in modified
0N/A * UTF-8 format; this string of characters
0N/A * is then returned as a <code>String</code>.
0N/A * <p>
0N/A * First, two bytes are read and used to
0N/A * construct an unsigned 16-bit integer in
0N/A * exactly the manner of the <code>readUnsignedShort</code>
0N/A * method . This integer value is called the
0N/A * <i>UTF length</i> and specifies the number
0N/A * of additional bytes to be read. These bytes
0N/A * are then converted to characters by considering
0N/A * them in groups. The length of each group
0N/A * is computed from the value of the first
0N/A * byte of the group. The byte following a
0N/A * group, if any, is the first byte of the
0N/A * next group.
0N/A * <p>
0N/A * If the first byte of a group
0N/A * matches the bit pattern <code>0xxxxxxx</code>
0N/A * (where <code>x</code> means "may be <code>0</code>
0N/A * or <code>1</code>"), then the group consists
0N/A * of just that byte. The byte is zero-extended
0N/A * to form a character.
0N/A * <p>
0N/A * If the first byte
0N/A * of a group matches the bit pattern <code>110xxxxx</code>,
0N/A * then the group consists of that byte <code>a</code>
0N/A * and a second byte <code>b</code>. If there
0N/A * is no byte <code>b</code> (because byte
0N/A * <code>a</code> was the last of the bytes
0N/A * to be read), or if byte <code>b</code> does
0N/A * not match the bit pattern <code>10xxxxxx</code>,
0N/A * then a <code>UTFDataFormatException</code>
0N/A * is thrown. Otherwise, the group is converted
0N/A * to the character:<p>
0N/A * <pre><code>(char)(((a&amp; 0x1F) &lt;&lt; 6) | (b &amp; 0x3F))
0N/A * </code></pre>
0N/A * If the first byte of a group
0N/A * matches the bit pattern <code>1110xxxx</code>,
0N/A * then the group consists of that byte <code>a</code>
0N/A * and two more bytes <code>b</code> and <code>c</code>.
0N/A * If there is no byte <code>c</code> (because
0N/A * byte <code>a</code> was one of the last
0N/A * two of the bytes to be read), or either
0N/A * byte <code>b</code> or byte <code>c</code>
0N/A * does not match the bit pattern <code>10xxxxxx</code>,
0N/A * then a <code>UTFDataFormatException</code>
0N/A * is thrown. Otherwise, the group is converted
0N/A * to the character:<p>
0N/A * <pre><code>
0N/A * (char)(((a &amp; 0x0F) &lt;&lt; 12) | ((b &amp; 0x3F) &lt;&lt; 6) | (c &amp; 0x3F))
0N/A * </code></pre>
0N/A * If the first byte of a group matches the
0N/A * pattern <code>1111xxxx</code> or the pattern
0N/A * <code>10xxxxxx</code>, then a <code>UTFDataFormatException</code>
0N/A * is thrown.
0N/A * <p>
0N/A * If end of file is encountered
0N/A * at any time during this entire process,
0N/A * then an <code>EOFException</code> is thrown.
0N/A * <p>
0N/A * After every group has been converted to
0N/A * a character by this process, the characters
0N/A * are gathered, in the same order in which
0N/A * their corresponding groups were read from
0N/A * the input stream, to form a <code>String</code>,
0N/A * which is returned.
0N/A * <p>
0N/A * The <code>writeUTF</code>
0N/A * method of interface <code>DataOutput</code>
0N/A * may be used to write data that is suitable
0N/A * for reading by this method.
0N/A * @return a Unicode string.
0N/A * @exception EOFException if this stream reaches the end
0N/A * before reading all the bytes.
0N/A * @exception IOException if an I/O error occurs.
0N/A * @exception UTFDataFormatException if the bytes do not represent a
0N/A * valid modified UTF-8 encoding of a string.
0N/A */
0N/A String readUTF() throws IOException;
0N/A}