streammessage.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 927 行 · 第 1/4 页

HTML
927
字号
</DL>
<HR>

<A NAME="readInt()"><!-- --></A><H3>
readInt</H3>
<PRE>
public int <B>readInt</B>()
            throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Reads a 32-bit integer from the stream message.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a 32-bit integer value from the stream message, interpreted
 as an <code>int</code><DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to read the message
                         due to some internal error.<DD><CODE><A HREF="../../javax/jms/MessageEOFException.html">MessageEOFException</A></CODE> - if unexpected end of message stream has
                                been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html">MessageNotReadableException</A></CODE> - if the message is in write-only 
                                        mode.</DL>
</DD>
</DL>
<HR>

<A NAME="readLong()"><!-- --></A><H3>
readLong</H3>
<PRE>
public long <B>readLong</B>()
              throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Reads a 64-bit integer from the stream message.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a 64-bit integer value from the stream message, interpreted as
 a <code>long</code><DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to read the message
                         due to some internal error.<DD><CODE><A HREF="../../javax/jms/MessageEOFException.html">MessageEOFException</A></CODE> - if unexpected end of message stream has
                                been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html">MessageNotReadableException</A></CODE> - if the message is in write-only 
                                        mode.</DL>
</DD>
</DL>
<HR>

<A NAME="readFloat()"><!-- --></A><H3>
readFloat</H3>
<PRE>
public float <B>readFloat</B>()
                throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Reads a <code>float</code> from the stream message.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a <code>float</code> value from the stream message<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to read the message
                         due to some internal error.<DD><CODE><A HREF="../../javax/jms/MessageEOFException.html">MessageEOFException</A></CODE> - if unexpected end of message stream has
                                been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html">MessageNotReadableException</A></CODE> - if the message is in write-only 
                                        mode.</DL>
</DD>
</DL>
<HR>

<A NAME="readDouble()"><!-- --></A><H3>
readDouble</H3>
<PRE>
public double <B>readDouble</B>()
                  throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Reads a <code>double</code> from the stream message.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a <code>double</code> value from the stream message<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to read the message
                         due to some internal error.<DD><CODE><A HREF="../../javax/jms/MessageEOFException.html">MessageEOFException</A></CODE> - if unexpected end of message stream has
                                been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html">MessageNotReadableException</A></CODE> - if the message is in write-only 
                                        mode.</DL>
</DD>
</DL>
<HR>

<A NAME="readString()"><!-- --></A><H3>
readString</H3>
<PRE>
public java.lang.String <B>readString</B>()
                            throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Reads a <CODE>String</CODE> from the stream message.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a Unicode string from the stream message<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to read the message
                         due to some internal error.<DD><CODE><A HREF="../../javax/jms/MessageEOFException.html">MessageEOFException</A></CODE> - if unexpected end of message stream has
                                been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html">MessageNotReadableException</A></CODE> - if the message is in write-only 
                                        mode.</DL>
</DD>
</DL>
<HR>

<A NAME="readBytes(byte[])"><!-- --></A><H3>
readBytes</H3>
<PRE>
public int <B>readBytes</B>(byte[]&nbsp;value)
              throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Reads a byte array field from the stream message into the 
 specified <CODE>byte[]</CODE> object (the read buffer). 
 
 <P>To read the field value, <CODE>readBytes</CODE> should be 
 successively called 
 until it returns a value less than the length of the read buffer.
 The value of the bytes in the buffer following the last byte 
 read is undefined.
 
 <P>If <CODE>readBytes</CODE> returns a value equal to the length of the 
 buffer, a subsequent <CODE>readBytes</CODE> call must be made. If there 
 are no more bytes to be read, this call returns -1.
 
 <P>If the byte array field value is null, <CODE>readBytes</CODE> 
 returns -1.

 <P>If the byte array field value is empty, <CODE>readBytes</CODE> 
 returns 0.
 
 <P>Once the first <CODE>readBytes</CODE> call on a <CODE>byte[]</CODE>
 field value has been made,
 the full value of the field must be read before it is valid to read 
 the next field. An attempt to read the next field before that has 
 been done will throw a <CODE>MessageFormatException</CODE>.
 
 <P>To read the byte field value into a new <CODE>byte[]</CODE> object, 
 use the <CODE>readObject</CODE> method.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>value</CODE> - the buffer into which the data is read<DT><B>Returns:</B><DD>the total number of bytes read into the buffer, or -1 if 
 there is no more data because the end of the byte field has been 
 reached<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to read the message
                         due to some internal error.<DD><CODE><A HREF="../../javax/jms/MessageEOFException.html">MessageEOFException</A></CODE> - if unexpected end of message stream has
                                been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html">MessageNotReadableException</A></CODE> - if the message is in write-only 
                                        mode.<DT><B>See Also: </B><DD><A HREF="../../javax/jms/StreamMessage.html#readObject()"><CODE>readObject()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="readObject()"><!-- --></A><H3>
readObject</H3>
<PRE>
public java.lang.Object <B>readObject</B>()
                            throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Reads an object from the stream message.

 <P>This method can be used to return, in objectified format,
 an object in the Java programming language ("Java object") that has 
 been written to the stream with the equivalent
 <CODE>writeObject</CODE> method call, or its equivalent primitive
 <CODE>write<I>type</I></CODE> method.
  
 <P>Note that byte values are returned as <CODE>byte[]</CODE>, not 
 <CODE>Byte[]</CODE>.

 <P>An attempt to call <CODE>readObject</CODE> to read a byte field 
 value into a new <CODE>byte[]</CODE> object before the full value of the
 byte field has been read will throw a 
 <CODE>MessageFormatException</CODE>.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a Java object from the stream message, in objectified
 format (for example, if the object was written as an <CODE>int</CODE>, 
 an <CODE>Integer</CODE> is returned)<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to read the message
                         due to some internal error.<DD><CODE><A HREF="../../javax/jms/MessageEOFException.html">MessageEOFException</A></CODE> - if unexpected end of message stream has
                                been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html">MessageNotReadableException</A></CODE> - if the message is in write-only 
                                        mode.<DT><B>See Also: </B><DD><A HREF="../../javax/jms/StreamMessage.html#readBytes(byte[])"><CODE>readBytes(byte[] value)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="writeBoolean(boolean)"><!-- --></A><H3>
writeBoolean</H3>
<PRE>
public void <B>writeBoolean</B>(boolean&nbsp;value)
                  throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Writes a <code>boolean</code> to the stream message.
 The value <code>true</code> is written as the value 
 <code>(byte)1</code>; the value <code>false</code> is written as 
 the value <code>(byte)0</code>.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>value</CODE> - the <code>boolean</code> value to be written<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to write the message
                         due to some internal error.<DD><CODE><A HREF="../../javax/jms/MessageNotWriteableException.html">MessageNotWriteableException</A></CODE> - if the message is in read-only 
                                         mode.</DL>
</DD>
</DL>
<HR>

<A NAME="writeByte(byte)"><!-- --></A><H3>
writeByte</H3>
<PRE>
public void <B>writeByte</B>(byte&nbsp;value)
               throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Writes a <code>byte</code> to the stream message.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>value</CODE> - the <code>byte</code> value to be written<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to write the message
                         due to some internal error.<DD><CODE><A HREF="../../javax/jms/MessageNotWriteableException.html">MessageNotWriteableException</A></CODE> - if the message is in read-only 
                                         mode.</DL>
</DD>
</DL>
<HR>

<A NAME="writeShort(short)"><!-- --></A><H3>
writeShort</H3>
<PRE>
public void <B>writeShort</B>(short&nbsp;value)
                throws <A HREF="../../javax/jms/JMSException.html">JMSException</A></PRE>
<DL>
<DD>Writes a <code>short</code> to the stream message.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>value</CODE> - the <code>short</code> value to be written<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/jms/JMSException.html">JMSException</A></CODE> - if the JMS provider fails to write the message
                         due to some internal error.<DD><CODE><A HREF="../../javax/jms/MessageNotWriteableException.html">MessageNotWriteableException</A></CODE> - if the message is in read-only 
                                         mode.</DL>
</DD>
</DL>
<HR>

<A NAME="writeChar(char)"><!-- --></A><H3>
writeChar</H3>
<PRE>

⌨️ 快捷键说明

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