src/java.base/share/classes/java/io/DataOutputStream.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54309 c4c225b49c5f
child 58679 9c3209ff7550
--- a/src/java.base/share/classes/java/io/DataOutputStream.java	Thu Oct 17 20:27:44 2019 +0100
+++ b/src/java.base/share/classes/java/io/DataOutputStream.java	Thu Oct 17 20:53:35 2019 +0100
@@ -49,7 +49,7 @@
 
     /**
      * Creates a new data output stream to write data to the specified
-     * underlying output stream. The counter <code>written</code> is
+     * underlying output stream. The counter {@code written} is
      * set to zero.
      *
      * @param   out   the underlying output stream, to be saved for later
@@ -74,14 +74,14 @@
 
     /**
      * Writes the specified byte (the low eight bits of the argument
-     * <code>b</code>) to the underlying output stream. If no exception
-     * is thrown, the counter <code>written</code> is incremented by
-     * <code>1</code>.
+     * {@code b}) to the underlying output stream. If no exception
+     * is thrown, the counter {@code written} is incremented by
+     * {@code 1}.
      * <p>
-     * Implements the <code>write</code> method of <code>OutputStream</code>.
+     * Implements the {@code write} method of {@code OutputStream}.
      *
-     * @param      b   the <code>byte</code> to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @param      b   the {@code byte} to be written.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
     public synchronized void write(int b) throws IOException {
@@ -90,15 +90,15 @@
     }
 
     /**
-     * Writes <code>len</code> bytes from the specified byte array
-     * starting at offset <code>off</code> to the underlying output stream.
-     * If no exception is thrown, the counter <code>written</code> is
-     * incremented by <code>len</code>.
+     * Writes {@code len} bytes from the specified byte array
+     * starting at offset {@code off} to the underlying output stream.
+     * If no exception is thrown, the counter {@code written} is
+     * incremented by {@code len}.
      *
      * @param      b     the data.
      * @param      off   the start offset in the data.
      * @param      len   the number of bytes to write.
-     * @exception  IOException  if an I/O error occurs.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
     public synchronized void write(byte b[], int off, int len)
@@ -112,10 +112,10 @@
      * Flushes this data output stream. This forces any buffered output
      * bytes to be written out to the stream.
      * <p>
-     * The <code>flush</code> method of <code>DataOutputStream</code>
-     * calls the <code>flush</code> method of its underlying output stream.
+     * The {@code flush} method of {@code DataOutputStream}
+     * calls the {@code flush} method of its underlying output stream.
      *
-     * @exception  IOException  if an I/O error occurs.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      * @see        java.io.OutputStream#flush()
      */
@@ -124,15 +124,15 @@
     }
 
     /**
-     * Writes a <code>boolean</code> to the underlying output stream as
-     * a 1-byte value. The value <code>true</code> is written out as the
-     * value <code>(byte)1</code>; the value <code>false</code> is
-     * written out as the value <code>(byte)0</code>. If no exception is
-     * thrown, the counter <code>written</code> is incremented by
-     * <code>1</code>.
+     * Writes a {@code boolean} to the underlying output stream as
+     * a 1-byte value. The value {@code true} is written out as the
+     * value {@code (byte)1}; the value {@code false} is
+     * written out as the value {@code (byte)0}. If no exception is
+     * thrown, the counter {@code written} is incremented by
+     * {@code 1}.
      *
-     * @param      v   a <code>boolean</code> value to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @param      v   a {@code boolean} value to be written.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
     public final void writeBoolean(boolean v) throws IOException {
@@ -141,12 +141,12 @@
     }
 
     /**
-     * Writes out a <code>byte</code> to the underlying output stream as
+     * Writes out a {@code byte} to the underlying output stream as
      * a 1-byte value. If no exception is thrown, the counter
-     * <code>written</code> is incremented by <code>1</code>.
+     * {@code written} is incremented by {@code 1}.
      *
-     * @param      v   a <code>byte</code> value to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @param      v   a {@code byte} value to be written.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
     public final void writeByte(int v) throws IOException {
@@ -155,12 +155,12 @@
     }
 
     /**
-     * Writes a <code>short</code> to the underlying output stream as two
+     * Writes a {@code short} to the underlying output stream as two
      * bytes, high byte first. If no exception is thrown, the counter
-     * <code>written</code> is incremented by <code>2</code>.
+     * {@code written} is incremented by {@code 2}.
      *
-     * @param      v   a <code>short</code> to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @param      v   a {@code short} to be written.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
     public final void writeShort(int v) throws IOException {
@@ -170,12 +170,12 @@
     }
 
     /**
-     * Writes a <code>char</code> to the underlying output stream as a
+     * Writes a {@code char} to the underlying output stream as a
      * 2-byte value, high byte first. If no exception is thrown, the
-     * counter <code>written</code> is incremented by <code>2</code>.
+     * counter {@code written} is incremented by {@code 2}.
      *
-     * @param      v   a <code>char</code> value to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @param      v   a {@code char} value to be written.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
     public final void writeChar(int v) throws IOException {
@@ -185,12 +185,12 @@
     }
 
     /**
-     * Writes an <code>int</code> to the underlying output stream as four
+     * Writes an {@code int} to the underlying output stream as four
      * bytes, high byte first. If no exception is thrown, the counter
-     * <code>written</code> is incremented by <code>4</code>.
+     * {@code written} is incremented by {@code 4}.
      *
-     * @param      v   an <code>int</code> to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @param      v   an {@code int} to be written.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
     public final void writeInt(int v) throws IOException {
@@ -204,12 +204,12 @@
     private byte writeBuffer[] = new byte[8];
 
     /**
-     * Writes a <code>long</code> to the underlying output stream as eight
+     * Writes a {@code long} to the underlying output stream as eight
      * bytes, high byte first. In no exception is thrown, the counter
-     * <code>written</code> is incremented by <code>8</code>.
+     * {@code written} is incremented by {@code 8}.
      *
-     * @param      v   a <code>long</code> to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @param      v   a {@code long} to be written.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
     public final void writeLong(long v) throws IOException {
@@ -226,15 +226,15 @@
     }
 
     /**
-     * Converts the float argument to an <code>int</code> using the
-     * <code>floatToIntBits</code> method in class <code>Float</code>,
-     * and then writes that <code>int</code> value to the underlying
+     * Converts the float argument to an {@code int} using the
+     * {@code floatToIntBits} method in class {@code Float},
+     * and then writes that {@code int} value to the underlying
      * output stream as a 4-byte quantity, high byte first. If no
-     * exception is thrown, the counter <code>written</code> is
-     * incremented by <code>4</code>.
+     * exception is thrown, the counter {@code written} is
+     * incremented by {@code 4}.
      *
-     * @param      v   a <code>float</code> value to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @param      v   a {@code float} value to be written.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      * @see        java.lang.Float#floatToIntBits(float)
      */
@@ -243,15 +243,15 @@
     }
 
     /**
-     * Converts the double argument to a <code>long</code> using the
-     * <code>doubleToLongBits</code> method in class <code>Double</code>,
-     * and then writes that <code>long</code> value to the underlying
+     * Converts the double argument to a {@code long} using the
+     * {@code doubleToLongBits} method in class {@code Double},
+     * and then writes that {@code long} value to the underlying
      * output stream as an 8-byte quantity, high byte first. If no
-     * exception is thrown, the counter <code>written</code> is
-     * incremented by <code>8</code>.
+     * exception is thrown, the counter {@code written} is
+     * incremented by {@code 8}.
      *
-     * @param      v   a <code>double</code> value to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @param      v   a {@code double} value to be written.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      * @see        java.lang.Double#doubleToLongBits(double)
      */
@@ -263,11 +263,11 @@
      * Writes out the string to the underlying output stream as a
      * sequence of bytes. Each character in the string is written out, in
      * sequence, by discarding its high eight bits. If no exception is
-     * thrown, the counter <code>written</code> is incremented by the
-     * length of <code>s</code>.
+     * thrown, the counter {@code written} is incremented by the
+     * length of {@code s}.
      *
      * @param      s   a string of bytes to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.FilterOutputStream#out
      */
     public final void writeBytes(String s) throws IOException {
@@ -281,12 +281,12 @@
     /**
      * Writes a string to the underlying output stream as a sequence of
      * characters. Each character is written to the data output stream as
-     * if by the <code>writeChar</code> method. If no exception is
-     * thrown, the counter <code>written</code> is incremented by twice
-     * the length of <code>s</code>.
+     * if by the {@code writeChar} method. If no exception is
+     * thrown, the counter {@code written} is incremented by twice
+     * the length of {@code s}.
      *
-     * @param      s   a <code>String</code> value to be written.
-     * @exception  IOException  if an I/O error occurs.
+     * @param      s   a {@code String} value to be written.
+     * @throws     IOException  if an I/O error occurs.
      * @see        java.io.DataOutputStream#writeChar(int)
      * @see        java.io.FilterOutputStream#out
      */
@@ -306,15 +306,15 @@
      * encoding in a machine-independent manner.
      * <p>
      * First, two bytes are written to the output stream as if by the
-     * <code>writeShort</code> method giving the number of bytes to
+     * {@code writeShort} method giving the number of bytes to
      * follow. This value is the number of bytes actually written out,
      * not the length of the string. Following the length, each character
      * of the string is output, in sequence, using the modified UTF-8 encoding
      * for the character. If no exception is thrown, the counter
-     * <code>written</code> is incremented by the total number of
+     * {@code written} is incremented by the total number of
      * bytes written to the output stream. This will be at least two
-     * plus the length of <code>str</code>, and at most two plus
-     * thrice the length of <code>str</code>.
+     * plus the length of {@code str}, and at most two plus
+     * thrice the length of {@code str}.
      *
      * @param      str   a string to be written.
      * @throws     UTFDataFormatException  if the modified UTF-8 encoding of
@@ -331,15 +331,15 @@
      * <a href="DataInput.html#modified-utf-8">modified UTF-8</a>
      * encoding in a machine-independent manner.
      * <p>
-     * First, two bytes are written to out as if by the <code>writeShort</code>
+     * First, two bytes are written to out as if by the {@code writeShort}
      * method giving the number of bytes to follow. This value is the number of
      * bytes actually written out, not the length of the string. Following the
      * length, each character of the string is output, in sequence, using the
      * modified UTF-8 encoding for the character. If no exception is thrown, the
-     * counter <code>written</code> is incremented by the total number of
+     * counter {@code written} is incremented by the total number of
      * bytes written to the output stream. This will be at least two
-     * plus the length of <code>str</code>, and at most two plus
-     * thrice the length of <code>str</code>.
+     * plus the length of {@code str}, and at most two plus
+     * thrice the length of {@code str}.
      *
      * @param      str   a string to be written.
      * @param      out   destination to write to
@@ -410,11 +410,11 @@
     }
 
     /**
-     * Returns the current value of the counter <code>written</code>,
+     * Returns the current value of the counter {@code written},
      * the number of bytes written to this data output stream so far.
      * If the counter overflows, it will be wrapped to Integer.MAX_VALUE.
      *
-     * @return  the value of the <code>written</code> field.
+     * @return  the value of the {@code written} field.
      * @see     java.io.DataOutputStream#written
      */
     public final int size() {