📄 streammessage.java
字号:
* 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. * * @param value the buffer into which the data is read * * @return 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 * * @exception JMSException if the JMS provider fails to read the message * due to some internal error. * @exception MessageEOFException if unexpected end of message stream has * been reached. * @exception MessageFormatException if this type conversion is invalid. * @exception MessageNotReadableException if the message is in write-only * mode. * * @see #readObject() */ int readBytes(byte[] value) throws JMSException; /** 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>. * * @return 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) * * @exception JMSException if the JMS provider fails to read the message * due to some internal error. * @exception MessageEOFException if unexpected end of message stream has * been reached. * @exception MessageFormatException if this type conversion is invalid. * @exception MessageNotReadableException if the message is in write-only * mode. * * @see #readBytes(byte[] value) */ Object readObject() throws JMSException; /** 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>. * * @param value the <code>boolean</code> value to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeBoolean(boolean value) throws JMSException; /** Writes a <code>byte</code> to the stream message. * * @param value the <code>byte</code> value to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeByte(byte value) throws JMSException; /** Writes a <code>short</code> to the stream message. * * @param value the <code>short</code> value to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeShort(short value) throws JMSException; /** Writes a <code>char</code> to the stream message. * * @param value the <code>char</code> value to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeChar(char value) throws JMSException; /** Writes an <code>int</code> to the stream message. * * @param value the <code>int</code> value to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeInt(int value) throws JMSException; /** Writes a <code>long</code> to the stream message. * * @param value the <code>long</code> value to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeLong(long value) throws JMSException; /** Writes a <code>float</code> to the stream message. * * @param value the <code>float</code> value to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeFloat(float value) throws JMSException; /** Writes a <code>double</code> to the stream message. * * @param value the <code>double</code> value to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeDouble(double value) throws JMSException; /** Writes a <code>String</code> to the stream message. * * @param value the <code>String</code> value to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeString(String value) throws JMSException; /** Writes a byte array field to the stream message. * * <P>The byte array <code>value</code> is written to the message * as a byte array field. Consecutively written byte array fields are * treated as two distinct fields when the fields are read. * * @param value the byte array value to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeBytes(byte[] value) throws JMSException; /** Writes a portion of a byte array as a byte array field to the stream * message. * * <P>The a portion of the byte array <code>value</code> is written to the * message as a byte array field. Consecutively written byte * array fields are treated as two distinct fields when the fields are * read. * * @param value the byte array value to be written * @param offset the initial offset within the byte array * @param length the number of bytes to use * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeBytes(byte[] value, int offset, int length) throws JMSException; /** Writes an object to the stream message. * * <P>This method works only for the objectified primitive * object types (<code>Integer</code>, <code>Double</code>, * <code>Long</code> ...), <code>String</code> objects, and byte * arrays. * * @param value the Java object to be written * * @exception JMSException if the JMS provider fails to write the message * due to some internal error. * @exception MessageFormatException if the object is invalid. * @exception MessageNotWriteableException if the message is in read-only * mode. */ void writeObject(Object value) throws JMSException; /** Puts the message body in read-only mode and repositions the stream * to the beginning. * * @exception JMSException if the JMS provider fails to reset the message * due to some internal error. * @exception MessageFormatException if the message has an invalid * format. */ void reset() throws JMSException;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -