/[classpath]/classpath/java/io/DataInputStream.java
ViewVC logotype

Diff of /classpath/java/io/DataInputStream.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by mkoch, Mon May 5 13:43:04 2003 UTC revision 1.22 by mkoch, Fri May 9 13:30:35 2003 UTC
# Line 189  public class DataInputStream extends Fil Line 189  public class DataInputStream extends Fil
189     *     *
190     * @see DataOutput#writeChar     * @see DataOutput#writeChar
191     */     */
192    public synchronized final char readChar() throws IOException    public synchronized final char readChar () throws IOException
193    {    {
194      readFully (buf, 0, 2);      readFully (buf, 0, 2);
195      return (char) ((buf[0] << 8) | (buf[1] & 0xff));      return (char) ((buf[0] << 8) | (buf[1] & 0xff));
# Line 254  public class DataInputStream extends Fil Line 254  public class DataInputStream extends Fil
254     * In this case, the method will return immediately without reading any     * In this case, the method will return immediately without reading any
255     * bytes from the stream.     * bytes from the stream.
256     *     *
257     * @param buf The buffer into which to read the data     * @param b The buffer into which to read the data
258     *     *
259     * @exception EOFException If end of file is reached before filling the     * @exception EOFException If end of file is reached before filling the
260     * buffer     * buffer
# Line 324  public class DataInputStream extends Fil Line 324  public class DataInputStream extends Fil
324     *     *
325     * @see DataOutput#writeInt     * @see DataOutput#writeInt
326     */     */
327    public synchronized final int readInt() throws IOException    public synchronized final int readInt () throws IOException
328    {    {
329      readFully (buf, 0, 4);      readFully (buf, 0, 4);
330      return (((buf[0] & 0xff) << 24) | ((buf[1] & 0xff) << 16) |      return (((buf[0] & 0xff) << 24) |
331              ((buf[2] & 0xff) << 8) | (buf[3] & 0xff));              ((buf[1] & 0xff) << 16) |
332                ((buf[2] & 0xff) << 8) |
333                (buf[3] & 0xff));
334    }    }
335    
336    /**    /**
# Line 346  public class DataInputStream extends Fil Line 348  public class DataInputStream extends Fil
348     * <code>\r\n</code>.  These termination charaters are discarded and     * <code>\r\n</code>.  These termination charaters are discarded and
349     * are not returned as part of the string.     * are not returned as part of the string.
350     * <p>     * <p>
351       * This method can read data that was written by an object implementing the
352       * <code>writeLine()</code> method in <code>DataOutput</code>.
353     *     *
354     * @return The line read as a <code>String</code>     * @return The line read as a <code>String</code>
355     *     *
356     * @exception IOException If an error occurs     * @exception IOException If an error occurs
357     *     *
358       * @see DataOutput
359       *
360     * @deprecated     * @deprecated
361     */     */
362    public final String readLine() throws IOException    public final String readLine() throws IOException
# Line 471  public class DataInputStream extends Fil Line 477  public class DataInputStream extends Fil
477     *     *
478     * @see DataOutput#writeLong     * @see DataOutput#writeLong
479     */     */
480    public synchronized final long readLong() throws IOException    public synchronized final long readLong () throws IOException
481    {    {
482      readFully (buf, 0, 8);      readFully (buf, 0, 8);
483      return (((long)(buf[0] & 0xff) << 56) |      return (((long)(buf[0] & 0xff) << 56) |
# Line 523  public class DataInputStream extends Fil Line 529  public class DataInputStream extends Fil
529     * 255.     * 255.
530     * <p>     * <p>
531     * This method can read an unsigned byte written by an object     * This method can read an unsigned byte written by an object
532     * implementing the <code>writeByte()</code> method in the     * implementing the <code>writeUnsignedByte()</code> method in the
533     * <code>DataOutput</code> interface.     * <code>DataOutput</code> interface.
534     *     *
535     * @return The unsigned bytes value read as a Java <code>int</code>.     * @return The unsigned bytes value read as a Java <code>int</code>.
# Line 599  public class DataInputStream extends Fil Line 605  public class DataInputStream extends Fil
605     * The value returned is in the range of 0 to 65535.     * The value returned is in the range of 0 to 65535.
606     * <p>     * <p>
607     * This method can read an unsigned short written by an object     * This method can read an unsigned short written by an object
608     * implementing the <code>writeShort()</code> method in the     * implementing the <code>writeUnsignedShort()</code> method in the
609     * <code>DataOutput</code> interface.     * <code>DataOutput</code> interface.
610     *     *
611     * @return The unsigned short value read as a Java <code>int</code>     * @return The unsigned short value read as a Java <code>int</code>
# Line 736  public class DataInputStream extends Fil Line 742  public class DataInputStream extends Fil
742     * This method will not skip any bytes if passed a negative number of bytes     * This method will not skip any bytes if passed a negative number of bytes
743     * to skip.     * to skip.
744     *     *
745     * @param numBytes The requested number of bytes to skip.     * @param n The requested number of bytes to skip.
746     *     *
747     * @return The requested number of bytes to skip.     * @return The requested number of bytes to skip.
748     *     *

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26