src/share/classes/java/io/DataOutput.java

Print this page
rev 10048 : 8044740: Convert all JDK versions used in @since tag to 1.n[.n] in jdk repo
Reviewed-by:


  27 
  28 /**
  29  * The <code>DataOutput</code> interface provides
  30  * for converting data from any of the Java
  31  * primitive types to a series of bytes and
  32  * writing these bytes to a binary stream.
  33  * There is  also a facility for converting
  34  * a <code>String</code> into
  35  * <a href="DataInput.html#modified-utf-8">modified UTF-8</a>
  36  * format and writing the resulting series
  37  * of bytes.
  38  * <p>
  39  * For all the methods in this interface that
  40  * write bytes, it is generally true that if
  41  * a byte cannot be written for any reason,
  42  * an <code>IOException</code> is thrown.
  43  *
  44  * @author  Frank Yellin
  45  * @see     java.io.DataInput
  46  * @see     java.io.DataOutputStream
  47  * @since   JDK1.0
  48  */
  49 public
  50 interface DataOutput {
  51     /**
  52      * Writes to the output stream the eight
  53      * low-order bits of the argument <code>b</code>.
  54      * The 24 high-order  bits of <code>b</code>
  55      * are ignored.
  56      *
  57      * @param      b   the byte to be written.
  58      * @throws     IOException  if an I/O error occurs.
  59      */
  60     void write(int b) throws IOException;
  61 
  62     /**
  63      * Writes to the output stream all the bytes in array <code>b</code>.
  64      * If <code>b</code> is <code>null</code>,
  65      * a <code>NullPointerException</code> is thrown.
  66      * If <code>b.length</code> is zero, then
  67      * no bytes are written. Otherwise, the byte




  27 
  28 /**
  29  * The <code>DataOutput</code> interface provides
  30  * for converting data from any of the Java
  31  * primitive types to a series of bytes and
  32  * writing these bytes to a binary stream.
  33  * There is  also a facility for converting
  34  * a <code>String</code> into
  35  * <a href="DataInput.html#modified-utf-8">modified UTF-8</a>
  36  * format and writing the resulting series
  37  * of bytes.
  38  * <p>
  39  * For all the methods in this interface that
  40  * write bytes, it is generally true that if
  41  * a byte cannot be written for any reason,
  42  * an <code>IOException</code> is thrown.
  43  *
  44  * @author  Frank Yellin
  45  * @see     java.io.DataInput
  46  * @see     java.io.DataOutputStream
  47  * @since   1.0
  48  */
  49 public
  50 interface DataOutput {
  51     /**
  52      * Writes to the output stream the eight
  53      * low-order bits of the argument <code>b</code>.
  54      * The 24 high-order  bits of <code>b</code>
  55      * are ignored.
  56      *
  57      * @param      b   the byte to be written.
  58      * @throws     IOException  if an I/O error occurs.
  59      */
  60     void write(int b) throws IOException;
  61 
  62     /**
  63      * Writes to the output stream all the bytes in array <code>b</code>.
  64      * If <code>b</code> is <code>null</code>,
  65      * a <code>NullPointerException</code> is thrown.
  66      * If <code>b.length</code> is zero, then
  67      * no bytes are written. Otherwise, the byte