outputstream.html

来自「维信SDK文档。源码要求为至少5个C或Java源码」· HTML 代码 · 共 630 行 · 第 1/2 页

HTML
630
字号
 to this output stream. The general contract for <code>write(b)</code> is that it should have exactly the same effect as the call <code>write(b, 0, b.length())</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - the data.<DT><B>See Also:</B><DD><A HREF="../../widsets/api/OutputStream.html#write(ByteArray, int, int)"><CODE>write(ByteArray, int, int)</CODE></A></DL></DD></DL><HR><A NAME="write(ByteArray, int, int)"><!-- --></A><H3>write</H3><PRE>       void <B>write</B>(<A HREF="../../widsets/api/ByteArray.html" title="class in ">ByteArray</A>&nbsp;b,                  int&nbsp;off,                  int&nbsp;len)</PRE><DL><DD>Writes <code>len</code> bytes from the specified byte array starting at offset <code>off</code> to this output stream. The general contract for <code>write(b, off, len)</code> is that some of the bytes in the array <code>b</code> are written to the output stream in order; element <code>b[off]</code> is the first byte written and <code>b[off+len-1]</code> is the last byte written by this operation. <p> The <code>write</code> method of <code>OutputStream</code> calls the write method of one argument on each of the bytes to be written out. Subclasses are encouraged to override this method and provide a more efficient implementation. <p> If <code>off</code> is negative, or <code>len</code> is negative, or <code>off+len</code> is greater than the length of the array <code>b</code>, then an <tt>IndexOutOfBoundsException</tt> is thrown.<P><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.</DL></DD></DL><HR><A NAME="write(int)"><!-- --></A><H3>write</H3><PRE>       void <B>write</B>(int&nbsp;b)</PRE><DL><DD>Writes the specified byte to this output stream. The general contract for <code>write</code> is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument <code>b</code>. The 24 high-order bits of <code>b</code> are ignored.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>b</CODE> - the <code>byte</code>.</DL></DD></DL><HR><A NAME="writeBoolean(boolean)"><!-- --></A><H3>writeBoolean</H3><PRE>       void <B>writeBoolean</B>(boolean&nbsp;v)</PRE><DL><DD>Writes a <code>boolean</code> value to this output stream. If the argument <code>v</code> is <code>true</code>, the value <code>(byte)1</code> is written; if <code>v</code> is <code>false</code>, the  value <code>(byte)0</code> is written. The byte written by this method may be read by the  <A HREF="../../widsets/api/InputStream.html#readBoolean()"><CODE>InputStream.readBoolean()</CODE></A>, which will then return a <code>boolean</code> equal to <code>v</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - the boolean to be written.</DL></DD></DL><HR><A NAME="writeByte(int)"><!-- --></A><H3>writeByte</H3><PRE>       void <B>writeByte</B>(int&nbsp;v)</PRE><DL><DD>Writes to the output stream the eight low- order bits of the argument <code>v</code>. The 24 high-order bits of <code>v</code> are ignored. (This means  that <code>writeByte</code> does exactly the same thing as <code>write</code> for an integer argument.) The byte written by this method may be read by the  <A HREF="../../widsets/api/InputStream.html#readByte()"><CODE>InputStream.readByte()</CODE></A>, which will then return a <code>byte</code> equal to <code>(byte)v</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - the byte value to be written.</DL></DD></DL><HR><A NAME="writeChar(char)"><!-- --></A><H3>writeChar</H3><PRE>       void <B>writeChar</B>(char&nbsp;v)</PRE><DL><DD>Writes a <code>char</code> value, which is comprised of two bytes, to the output stream. The byte values to be written, in the  order shown, are: <p><pre><code> (byte)(0xff &amp; (v &gt;&gt; 8)) (byte)(0xff &amp; v) </code></pre><p> The bytes written by this method may be read by the  <A HREF="../../widsets/api/InputStream.html#readChar()"><CODE>InputStream.readChar()</CODE></A>, which will then return a <code>char</code> equal to <code>(char)v</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - the <code>char</code> value to be written.</DL></DD></DL><HR><A NAME="writeInt(int)"><!-- --></A><H3>writeInt</H3><PRE>       void <B>writeInt</B>(int&nbsp;v)</PRE><DL><DD>Writes an <code>int</code> value, which is comprised of four bytes, to the output stream. The byte values to be written, in the  order shown, are: <p><pre><code> (byte)(0xff &amp; (v &gt;&gt; 24)) (byte)(0xff &amp; (v &gt;&gt; 16)) (byte)(0xff &amp; (v &gt;&gt; &#32; &#32;8)) (byte)(0xff &amp; v) </code></pre><p> The bytes written by this method may be read by the <code>readInt</code>  <A HREF="../../widsets/api/InputStream.html#readInt()"><CODE>InputStream.readInt()</CODE></A>,  which will then return an <code>int</code> equal to <code>v</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - the <code>int</code> value to be written.</DL></DD></DL><HR><A NAME="writeLong(long)"><!-- --></A><H3>writeLong</H3><PRE>       void <B>writeLong</B>(long&nbsp;v)</PRE><DL><DD>Writes an <code>long</code> value, which is comprised of four bytes, to the output stream. The byte values to be written, in the  order shown, are: <p><pre><code> (byte)(0xff &amp; (v &gt;&gt; 48)) (byte)(0xff &amp; (v &gt;&gt; 40)) (byte)(0xff &amp; (v &gt;&gt; 32)) (byte)(0xff &amp; (v &gt;&gt; 24)) (byte)(0xff &amp; (v &gt;&gt; 16)) (byte)(0xff &amp; (v &gt;&gt;  8)) (byte)(0xff &amp; v) </code></pre><p> The bytes written by this method may be read by the  <A HREF="../../widsets/api/InputStream.html#readLong()"><CODE>InputStream.readLong()</CODE></A>, which will then return a <code>long</code> equal to <code>v</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - the <code>long</code> value to be written.</DL></DD></DL><HR><A NAME="writeShort(int)"><!-- --></A><H3>writeShort</H3><PRE>       void <B>writeShort</B>(int&nbsp;v)</PRE><DL><DD>Writes two bytes to the output stream to represent the value of the argument. The byte values to be written, in the  order shown, are: <p> <pre><code> (byte)(0xff &amp; (v &gt;&gt; 8)) (byte)(0xff &amp; v) </code> </pre> <p> The bytes written by this method may be read by the  <A HREF="../../widsets/api/InputStream.html#readShort()"><CODE>InputStream.readShort()</CODE></A>, which will then return a <code>short</code> equal to <code>(short)v</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>v</CODE> - the <code>short</code> value to be written.</DL></DD></DL><HR><A NAME="writeUTF(String)"><!-- --></A><H3>writeUTF</H3><PRE>       void <B>writeUTF</B>(<A HREF="../../widsets/api/String.html" title="class in ">String</A>&nbsp;str)</PRE><DL><DD>Writes two bytes of length information to the output stream, followed by the Java modified UTF representation of  every character in the string <code>s</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>str</CODE> - the string value to be written.</DL></DD></DL><HR><A NAME="writeValue(Value)"><!-- --></A><H3>writeValue</H3><PRE>       void <B>writeValue</B>(<A HREF="../../widsets/api/Value.html" title="class in ">Value</A>&nbsp;value)</PRE><DL><DD>Serializes specified structure into this output stream.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - Value to write</DL></DD></DL><HR><A NAME="toByteArray()"><!-- --></A><H3>toByteArray</H3><PRE>       <A HREF="../../widsets/api/ByteArray.html" title="class in ">ByteArray</A> <B>toByteArray</B>()</PRE><DL><DD>Returns the contents of memory buffer that is backing up this OutputStream.<P><DD><DL><DT><B>Returns:</B><DD>ByteArray instance that contains         all the bytes written.</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=2 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="../../widsets/api/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="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></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../widsets/api/Object.html" title="class in "><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../widsets/api/PaintCallback.html" title="interface in "><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html?widsets/api/OutputStream.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="OutputStream.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;FIELD&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;FIELD&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></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?