src/share/classes/java/io/DataOutputStream.java

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


  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.io;
  27 
  28 /**
  29  * A data output stream lets an application write primitive Java data
  30  * types to an output stream in a portable way. An application can
  31  * then use a data input stream to read the data back in.
  32  *
  33  * @author  unascribed
  34  * @see     java.io.DataInputStream
  35  * @since   JDK1.0
  36  */
  37 public
  38 class DataOutputStream extends FilterOutputStream implements DataOutput {
  39     /**
  40      * The number of bytes written to the data output stream so far.
  41      * If this counter overflows, it will be wrapped to Integer.MAX_VALUE.
  42      */
  43     protected int written;
  44 
  45     /**
  46      * bytearr is initialized on demand by writeUTF
  47      */
  48     private byte[] bytearr = null;
  49 
  50     /**
  51      * Creates a new data output stream to write data to the specified
  52      * underlying output stream. The counter <code>written</code> is
  53      * set to zero.
  54      *
  55      * @param   out   the underlying output stream, to be saved for later




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package java.io;
  27 
  28 /**
  29  * A data output stream lets an application write primitive Java data
  30  * types to an output stream in a portable way. An application can
  31  * then use a data input stream to read the data back in.
  32  *
  33  * @author  unascribed
  34  * @see     java.io.DataInputStream
  35  * @since   1.0
  36  */
  37 public
  38 class DataOutputStream extends FilterOutputStream implements DataOutput {
  39     /**
  40      * The number of bytes written to the data output stream so far.
  41      * If this counter overflows, it will be wrapped to Integer.MAX_VALUE.
  42      */
  43     protected int written;
  44 
  45     /**
  46      * bytearr is initialized on demand by writeUTF
  47      */
  48     private byte[] bytearr = null;
  49 
  50     /**
  51      * Creates a new data output stream to write data to the specified
  52      * underlying output stream. The counter <code>written</code> is
  53      * set to zero.
  54      *
  55      * @param   out   the underlying output stream, to be saved for later