<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_03) on Mon Oct 10 16:31:46 CEST 2005 -->
<TITLE>
DataOutputStream (IM Profile)
</TITLE>

<META NAME="keywords" CONTENT="java.io.DataOutputStream class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="DataOutputStream (IM Profile)";
}
</SCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DataOutputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>IM Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../java/io/DataInputStream.html" title="class in java.io"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../java/io/InputStream.html" title="class in java.io"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="DataOutputStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
java.io</FONT>
<BR>
Class DataOutputStream</H2>
<PRE>
<A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
  <IMG SRC="../../resources/inherit.gif" ALT="extended by"><A HREF="../../java/io/OutputStream.html" title="class in java.io">java.io.OutputStream</A>
      <IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>java.io.DataOutputStream</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></DD>
</DL>
<HR>
<DL>
<DT>public class <B>DataOutputStream</B><DT>extends <A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A><DT>implements <A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></DL>

<P>
A data output stream lets an application write primitive Java data
 types to an output stream in a portable way. An application can
 then use a data input stream to read the data back in.
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>JDK1.0, CLDC 1.0</DD>
<DT><B>See Also:</B><DD><A HREF="../../java/io/DataInputStream.html" title="class in java.io"><CODE>DataInputStream</CODE></A></DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#out">out</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The output stream.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#DataOutputStream(java.io.OutputStream)">DataOutputStream</A></B>(<A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A>&nbsp;out)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new data output stream to write data to the specified
 underlying output stream.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#close()">close</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes this output stream and releases any system resources
 associated with the stream.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#flush()">flush</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flushes this data output stream. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#write(byte[], int, int)">write</A></B>(byte[]&nbsp;b,
      int&nbsp;off,
      int&nbsp;len)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes <code>len</code> bytes from the specified byte array
 starting at offset <code>off</code> to the underlying output stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#write(int)">write</A></B>(int&nbsp;b)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes the specified byte (the low eight bits of the argument
 <code>b</code>) to the underlying output stream.
 </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#writeBoolean(boolean)">writeBoolean</A></B>(boolean&nbsp;v)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes a <code>boolean</code> to the underlying output stream as
 a 1-byte value. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#writeByte(int)">writeByte</A></B>(int&nbsp;v)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes out a <code>byte</code> to the underlying output stream as
 a 1-byte value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#writeChar(int)">writeChar</A></B>(int&nbsp;v)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes a <code>char</code> to the underlying output stream as a
 2-byte value, high byte first.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#writeChars(java.lang.String)">writeChars</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;s)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes a string to the underlying output stream as a sequence of
 characters. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#writeDouble(double)">writeDouble</A></B>(double&nbsp;v)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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
 output stream as an 8-byte quantity, high byte first.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#writeFloat(float)">writeFloat</A></B>(float&nbsp;v)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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
 output stream as a 4-byte quantity, high byte first.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#writeInt(int)">writeInt</A></B>(int&nbsp;v)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes an <code>int</code> to the underlying output stream as four
 bytes, high byte first.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#writeLong(long)">writeLong</A></B>(long&nbsp;v)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes a <code>long</code> to the underlying output stream as eight
 bytes, high byte first.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#writeShort(int)">writeShort</A></B>(int&nbsp;v)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes a <code>short</code> to the underlying output stream as two
 bytes, high byte first.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/io/DataOutputStream.html#writeUTF(java.lang.String)">writeUTF</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;str)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes a string to the underlying output stream using UTF-8
 encoding in a machine-independent manner.
 </TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.io.OutputStream"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.io.<A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/io/OutputStream.html#write(byte[])">write</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.io.DataOutput"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface java.io.<A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/io/DataOutput.html#write(byte[])">write</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="out"><!-- --></A><H3>
out</H3>
<PRE>
protected <A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A> <B>out</B></PRE>
<DL>
<DD>The output stream.
<P>
<DL>
</DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="DataOutputStream(java.io.OutputStream)"><!-- --></A><H3>
DataOutputStream</H3>
<PRE>
public <B>DataOutputStream</B>(<A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A>&nbsp;out)</PRE>
<DL>
<DD>Creates a new data output stream to write data to the specified
 underlying output stream.
<P>
<DT><B>Parameters:</B><DD><CODE>out</CODE> - the underlying output stream, to be saved for later
                use.</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="write(int)"><!-- --></A><H3>
write</H3>
<PRE>
public void <B>write</B>(int&nbsp;b)
           throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>Writes the specified byte (the low eight bits of the argument
 <code>b</code>) to the underlying output stream.
 <p>
 Implements the <code>write</code> method of <code>OutputStream</code>.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#write(int)">write</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE><DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#write(int)">write</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the <code>byte</code> to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="write(byte[], int, int)"><!-- --></A><H3>
write</H3>
<PRE>
public void <B>write</B>(byte[]&nbsp;b,
                  int&nbsp;off,
                  int&nbsp;len)
           throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>Writes <code>len</code> bytes from the specified byte array
 starting at offset <code>off</code> to the underlying output stream.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#write(byte[], int, int)">write</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#write(byte[], int, int)">write</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the data.<DD><CODE>off</CODE> - the start offset in the data.<DD><CODE>len</CODE> - the number of bytes to write.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="flush()"><!-- --></A><H3>
flush</H3>
<PRE>
public void <B>flush</B>()
           throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#flush()">flush</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
public void <B>close</B>()
           throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>Closes this output stream and releases any system resources
 associated with the stream.
 <p>
 The <code>close</code> method
 calls its <code>flush</code> method, and then calls the
 <code>close</code> method of its underlying output stream.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../java/io/OutputStream.html#close()">close</A></CODE> in class <CODE><A HREF="../../java/io/OutputStream.html" title="class in java.io">OutputStream</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="writeBoolean(boolean)"><!-- --></A><H3>
writeBoolean</H3>
<PRE>
public final void <B>writeBoolean</B>(boolean&nbsp;v)
                        throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>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>.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#writeBoolean(boolean)">writeBoolean</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - a <code>boolean</code> value to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="writeByte(int)"><!-- --></A><H3>
writeByte</H3>
<PRE>
public final void <B>writeByte</B>(int&nbsp;v)
                     throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>Writes out a <code>byte</code> to the underlying output stream as
 a 1-byte value.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#writeByte(int)">writeByte</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - a <code>byte</code> value to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="writeShort(int)"><!-- --></A><H3>
writeShort</H3>
<PRE>
public final void <B>writeShort</B>(int&nbsp;v)
                      throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>Writes a <code>short</code> to the underlying output stream as two
 bytes, high byte first.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#writeShort(int)">writeShort</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - a <code>short</code> to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="writeChar(int)"><!-- --></A><H3>
writeChar</H3>
<PRE>
public final void <B>writeChar</B>(int&nbsp;v)
                     throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>Writes a <code>char</code> to the underlying output stream as a
 2-byte value, high byte first.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#writeChar(int)">writeChar</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - a <code>char</code> value to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="writeInt(int)"><!-- --></A><H3>
writeInt</H3>
<PRE>
public final void <B>writeInt</B>(int&nbsp;v)
                    throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>Writes an <code>int</code> to the underlying output stream as four
 bytes, high byte first.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#writeInt(int)">writeInt</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - an <code>int</code> to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="writeLong(long)"><!-- --></A><H3>
writeLong</H3>
<PRE>
public final void <B>writeLong</B>(long&nbsp;v)
                     throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>Writes a <code>long</code> to the underlying output stream as eight
 bytes, high byte first.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#writeLong(long)">writeLong</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - a <code>long</code> to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<HR>

<A NAME="writeFloat(float)"><!-- --></A><H3>
writeFloat</H3>
<PRE>
public final void <B>writeFloat</B>(float&nbsp;v)
                      throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>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
 output stream as a 4-byte quantity, high byte first.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#writeFloat(float)">writeFloat</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - a <code>float</code> value to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.<DT><B>Since:</B></DT>
  <DD>CLDC 1.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../java/lang/Float.html#floatToIntBits(float)"><CODE>Float.floatToIntBits(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="writeDouble(double)"><!-- --></A><H3>
writeDouble</H3>
<PRE>
public final void <B>writeDouble</B>(double&nbsp;v)
                       throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>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
 output stream as an 8-byte quantity, high byte first.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#writeDouble(double)">writeDouble</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - a <code>double</code> value to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.<DT><B>Since:</B></DT>
  <DD>CLDC 1.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../java/lang/Double.html#doubleToLongBits(double)"><CODE>Double.doubleToLongBits(double)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="writeChars(java.lang.String)"><!-- --></A><H3>
writeChars</H3>
<PRE>
public final void <B>writeChars</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;s)
                      throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#writeChars(java.lang.String)">writeChars</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>s</CODE> - a <code>String</code> value to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.<DT><B>See Also:</B><DD><A HREF="../../java/io/DataOutputStream.html#writeChar(int)"><CODE>writeChar(int)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="writeUTF(java.lang.String)"><!-- --></A><H3>
writeUTF</H3>
<PRE>
public final void <B>writeUTF</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A>&nbsp;str)
                    throws <A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></PRE>
<DL>
<DD>Writes a string to the underlying output stream using UTF-8
 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
 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 UTF-8 encoding
 for the character.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../java/io/DataOutput.html#writeUTF(java.lang.String)">writeUTF</A></CODE> in interface <CODE><A HREF="../../java/io/DataOutput.html" title="interface in java.io">DataOutput</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>str</CODE> - a string to be written.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error occurs.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DataOutputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>IM Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../java/io/DataInputStream.html" title="class in java.io"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../java/io/InputStream.html" title="class in java.io"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="DataOutputStream.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<font size=\-1\><a href=\mailto:midp-feedback@risc.sps.mot.com\>Submit a comment or suggestion</a> Version 2.0 of IM Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems,  Inc. in the US and other countries. Copyright (c) 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font>
</BODY>
</HTML>
