📄 streammessage.html
字号:
</DL><HR><A NAME="readLong()"><!-- --></A><H3>readLong</H3><PRE>public long <B>readLong</B>() throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Reads a 64-bit integer from the stream message.<P><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" title="class in javax.jms">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" title="class in javax.jms">MessageEOFException</A></CODE> - if unexpected end of message stream has been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html" title="class in javax.jms">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html" title="class in javax.jms">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" title="class in javax.jms">JMSException</A></PRE><DL><DD>Reads a <code>float</code> from the stream message.<P><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" title="class in javax.jms">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" title="class in javax.jms">MessageEOFException</A></CODE> - if unexpected end of message stream has been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html" title="class in javax.jms">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html" title="class in javax.jms">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" title="class in javax.jms">JMSException</A></PRE><DL><DD>Reads a <code>double</code> from the stream message.<P><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" title="class in javax.jms">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" title="class in javax.jms">MessageEOFException</A></CODE> - if unexpected end of message stream has been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html" title="class in javax.jms">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html" title="class in javax.jms">MessageNotReadableException</A></CODE> - if the message is in write-only mode.</DL></DD></DL><HR><A NAME="readString()"><!-- --></A><H3>readString</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>readString</B>() throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Reads a <CODE>String</CODE> from the stream message.<P><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" title="class in javax.jms">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" title="class in javax.jms">MessageEOFException</A></CODE> - if unexpected end of message stream has been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html" title="class in javax.jms">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html" title="class in javax.jms">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[] value) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">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.<P><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" title="class in javax.jms">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" title="class in javax.jms">MessageEOFException</A></CODE> - if unexpected end of message stream has been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html" title="class in javax.jms">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html" title="class in javax.jms">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 <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>readObject</B>() throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">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>.<P><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" title="class in javax.jms">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" title="class in javax.jms">MessageEOFException</A></CODE> - if unexpected end of message stream has been reached.<DD><CODE><A HREF="../../javax/jms/MessageFormatException.html" title="class in javax.jms">MessageFormatException</A></CODE> - if this type conversion is invalid.<DD><CODE><A HREF="../../javax/jms/MessageNotReadableException.html" title="class in javax.jms">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 value) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">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>.<P><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" title="class in javax.jms">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" title="class in javax.jms">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 value) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Writes a <code>byte</code> to the stream message.<P><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" title="class in javax.jms">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" title="class in javax.jms">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 value) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Writes a <code>short</code> to the stream message.<P><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" title="class in javax.jms">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" title="class in javax.jms">MessageNotWriteableException</A></CODE> - if the message is in read-only mode.</DL></DD></DL><HR><A NAME="writeChar(char)"><!-- --></A><H3>writeChar</H3><PRE>public void <B>writeChar</B>(char value) throws <A HREF="../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</A></PRE><DL><DD>Writes a <code>char</code> to the stream message.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - the <code>char</code> value to be written<DT><B>Throws:</B>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -