< prev index next >

src/java.base/share/classes/java/io/DataInputStream.java

Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -87,11 +87,11 @@
      *
      * @param      b   the buffer into which the data is read.
      * @return     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.
-     * @exception  IOException if the first byte cannot be read for any reason
+     * @throws     IOException if the first byte cannot be read for any reason
      * other than end of file, the stream has been closed and the underlying
      * input stream does not support reading after close, or another I/O
      * error occurs.
      * @see        java.io.FilterInputStream#in
      * @see        java.io.InputStream#read(byte[], int, int)

@@ -132,15 +132,15 @@
      * @param off the start offset in the destination array <code>b</code>
      * @param      len   the maximum number of bytes read.
      * @return     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.
-     * @exception  NullPointerException If <code>b</code> is <code>null</code>.
-     * @exception  IndexOutOfBoundsException If <code>off</code> is negative,
+     * @throws     NullPointerException If <code>b</code> is <code>null</code>.
+     * @throws     IndexOutOfBoundsException If <code>off</code> is negative,
      * <code>len</code> is negative, or <code>len</code> is greater than
      * <code>b.length - off</code>
-     * @exception  IOException if the first byte cannot be read for any reason
+     * @throws     IOException if the first byte cannot be read for any reason
      * other than end of file, the stream has been closed and the underlying
      * input stream does not support reading after close, or another I/O
      * error occurs.
      * @see        java.io.FilterInputStream#in
      * @see        java.io.InputStream#read(byte[], int, int)

@@ -179,17 +179,17 @@
      * input stream.
      *
      * @param      b     the buffer into which the data is read.
      * @param      off   the start offset in the data array {@code b}.
      * @param      len   the number of bytes to read.
-     * @exception  NullPointerException if {@code b} is {@code null}.
-     * @exception  IndexOutOfBoundsException if {@code off} is negative,
+     * @throws     NullPointerException if {@code b} is {@code null}.
+     * @throws     IndexOutOfBoundsException if {@code off} is negative,
      *             {@code len} is negative, or {@code len} is greater than
      *             {@code b.length - off}.
-     * @exception  EOFException  if this input stream reaches the end before
+     * @throws     EOFException  if this input stream reaches the end before
      *             reading all the bytes.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
     public final void readFully(byte b[], int off, int len) throws IOException {

@@ -211,11 +211,11 @@
      * Bytes for this operation are read from the contained
      * input stream.
      *
      * @param      n   the number of bytes to be skipped.
      * @return     the actual number of bytes skipped.
-     * @exception  IOException  if the contained input stream does not support
+     * @throws     IOException  if the contained input stream does not support
      *             seek, or the stream has been closed and
      *             the contained input stream does not support
      *             reading after close, or another I/O error occurs.
      */
     public final int skipBytes(int n) throws IOException {

@@ -235,12 +235,12 @@
      * <p>
      * Bytes for this operation are read from the contained
      * input stream.
      *
      * @return     the <code>boolean</code> value read.
-     * @exception  EOFException  if this input stream has reached the end.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     EOFException  if this input stream has reached the end.
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
     public final boolean readBoolean() throws IOException {

@@ -258,12 +258,12 @@
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next byte of this input stream as a signed 8-bit
      *             <code>byte</code>.
-     * @exception  EOFException  if this input stream has reached the end.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     EOFException  if this input stream has reached the end.
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
     public final byte readByte() throws IOException {

@@ -281,12 +281,12 @@
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next byte of this input stream, interpreted as an
      *             unsigned 8-bit number.
-     * @exception  EOFException  if this input stream has reached the end.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     EOFException  if this input stream has reached the end.
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see         java.io.FilterInputStream#in
      */
     public final int readUnsignedByte() throws IOException {

@@ -304,13 +304,13 @@
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next two bytes of this input stream, interpreted as a
      *             signed 16-bit number.
-     * @exception  EOFException  if this input stream reaches the end before
+     * @throws     EOFException  if this input stream reaches the end before
      *               reading two bytes.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
     public final short readShort() throws IOException {

@@ -329,13 +329,13 @@
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next two bytes of this input stream, interpreted as an
      *             unsigned 16-bit integer.
-     * @exception  EOFException  if this input stream reaches the end before
+     * @throws     EOFException  if this input stream reaches the end before
      *             reading two bytes.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
     public final int readUnsignedShort() throws IOException {

@@ -354,13 +354,13 @@
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next two bytes of this input stream, interpreted as a
      *             <code>char</code>.
-     * @exception  EOFException  if this input stream reaches the end before
+     * @throws     EOFException  if this input stream reaches the end before
      *               reading two bytes.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
     public final char readChar() throws IOException {

@@ -379,13 +379,13 @@
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next four bytes of this input stream, interpreted as an
      *             <code>int</code>.
-     * @exception  EOFException  if this input stream reaches the end before
+     * @throws     EOFException  if this input stream reaches the end before
      *               reading four bytes.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
     public final int readInt() throws IOException {

@@ -408,13 +408,13 @@
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next eight bytes of this input stream, interpreted as a
      *             <code>long</code>.
-     * @exception  EOFException  if this input stream reaches the end before
+     * @throws     EOFException  if this input stream reaches the end before
      *               reading eight bytes.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see        java.io.FilterInputStream#in
      */
     public final long readLong() throws IOException {

@@ -437,13 +437,13 @@
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next four bytes of this input stream, interpreted as a
      *             <code>float</code>.
-     * @exception  EOFException  if this input stream reaches the end before
+     * @throws     EOFException  if this input stream reaches the end before
      *               reading four bytes.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see        java.io.DataInputStream#readInt()
      * @see        java.lang.Float#intBitsToFloat(int)
      */

@@ -459,13 +459,13 @@
      * for this operation are read from the contained
      * input stream.
      *
      * @return     the next eight bytes of this input stream, interpreted as a
      *             <code>double</code>.
-     * @exception  EOFException  if this input stream reaches the end before
+     * @throws     EOFException  if this input stream reaches the end before
      *               reading eight bytes.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
      * @see        java.io.DataInputStream#readLong()
      * @see        java.lang.Double#longBitsToDouble(long)
      */

@@ -496,11 +496,11 @@
      *     BufferedReader d
      *          =&nbsp;new&nbsp;BufferedReader(new&nbsp;InputStreamReader(in));
      * </pre></blockquote>
      *
      * @return     the next line of text from this input stream.
-     * @exception  IOException  if an I/O error occurs.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.BufferedReader#readLine()
      * @see        java.io.FilterInputStream#in
      */
     @Deprecated
     public final String readLine() throws IOException {

@@ -554,16 +554,16 @@
      * Bytes
      * for this operation are read from the contained
      * input stream.
      *
      * @return     a Unicode string.
-     * @exception  EOFException  if this input stream reaches the end before
+     * @throws     EOFException  if this input stream reaches the end before
      *               reading all the bytes.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
-     * @exception  UTFDataFormatException if the bytes do not represent a valid
+     * @throws     UTFDataFormatException if the bytes do not represent a valid
      *             modified UTF-8 encoding of a string.
      * @see        java.io.DataInputStream#readUTF(java.io.DataInput)
      */
     public final String readUTF() throws IOException {
         return readUTF(this);

@@ -579,16 +579,16 @@
      * are  exactly the same as for the <code>readUTF</code>
      * method of <code>DataInput</code>.
      *
      * @param      in   a data input stream.
      * @return     a Unicode string.
-     * @exception  EOFException            if the input stream reaches the end
+     * @throws     EOFException            if the input stream reaches the end
      *               before all the bytes.
-     * @exception  IOException   the stream has been closed and the contained
+     * @throws     IOException   the stream has been closed and the contained
      *             input stream does not support reading after close, or
      *             another I/O error occurs.
-     * @exception  UTFDataFormatException  if the bytes do not represent a
+     * @throws     UTFDataFormatException  if the bytes do not represent a
      *               valid modified UTF-8 encoding of a Unicode string.
      * @see        java.io.DataInputStream#readUnsignedShort()
      */
     public static final String readUTF(DataInput in) throws IOException {
         int utflen = in.readUnsignedShort();
< prev index next >