StreamMessage
public interface StreamMessage
extends Message
WebSphere MQ class: JMSStreamMessage
java.lang.Object | +----com.ibm.jms.JMSMessage | +----com.ibm.jms.JMSStreamMessageUse a StreamMessage to send a stream of Java primitives.
See also: BytesMessage, MapMessage, Message, ObjectMessage and TextMessage
Methods
- readBoolean
public boolean readBoolean() throws JMSException
Read a boolean from the stream message.
- Returns:
- The boolean value read.
- Throws:
- readByte
public byte readByte() throws JMSException
Read a byte value from the stream message.
- Returns:
- The next byte from the stream message as an 8-bit byte.
- Throws:
- readBytes
public int readBytes(byte[] value) throws JMSExceptioneam message.
Read a byte array field from the stream message into the specified byte[] object (the read buffer). If the buffer size is less than, or equal to, the size of the data in the message field, an application must make further calls to this method to retrieve the remainder of the data. Once the first readBytes call on a byte[] field value has been done, 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 throws a MessageFormatException.
- Parameters:
- value: the buffer into which the data is read.
- Returns:
- 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.
- Throws:
- readChar
public char readChar() throws JMSException
Read a Unicode character value from the stream message.
- Returns:
- A Unicode character from the stream message.
- Throws:
- readDouble
public double readDouble() throws JMSException
Read a double from the stream message.
- Returns:
- A double value from the stream message.
- Throws:
- readFloat
public float readFloat() throws JMSException
Read a float from the stream message.
- Returns:
- A float value from the stream message.
- Throws:
- readInt
public int readInt() throws JMSException
Read a 32-bit integer from the stream message.
- Returns:
- A 32-bit integer value from the stream message, interpreted as an int.
- Throws:
- readLong
public long readLong() throws JMSException
Read a 64-bit integer from the stream message.
- Returns:
- A 64-bit integer value from the stream message, interpreted as a long.
- Throws:
- readObject
public java.lang.Object readObject() throws JMSException
Read a Java object from the stream message.
- Returns:
- A Java object from the stream message in object format (for example, if it was set as an int, an integer is returned).
- Throws:
- readShort
public short readShort() throws JMSException
Read a 16-bit number from the stream message.
- Returns:
- A 16-bit number from the stream message.
- Throws:
- readString
public java.lang.String readString() throws JMSException
Read in a string from the stream message.
- Returns:
- A Unicode string from the stream message.
- Throws:
- reset
public void reset() throws JMSException
Put the message in read-only mode, and reposition the stream to the beginning.
- Throws:
- writeBoolean
public void writeBoolean(boolean value) throws JMSException
Write a boolean to the stream message.
- Parameters:
- value: the boolean value to be written.
- Throws:
- writeByte
public void writeByte(byte value) throws JMSException
Write a byte to the stream message.
- Parameters:
- value: the byte value to be written.
- Throws:
- writeBytes
public void writeBytes(byte[] value) throws JMSException
Write a byte array to the stream message.
- Parameters:
- value: the byte array to be written.
- Throws:
- writeBytes
public void writeBytes(byte[] value, int offset, int length) throws JMSException
Write a portion of a byte array to the stream message.
- Parameters:
- value: the byte array value to be written.
- offset: the initial offset within the byte array.
- length: the number of bytes to use.
- Throws:
- writeChar
public void writeChar(char value) throws JMSException
Write a character to the stream message.
- Parameters:
- value: the character value to be written.
- Throws:
- writeDouble
public void writeDouble(double value) throws JMSException
Write a double to the stream message.
- Parameters:
- value: the double value to be written.
- Throws:
- writeFloat
public void writeFloat(float value) throws JMSException
Write a float to the stream message.
- Parameters:
- value: the float value to be written.
- Throws:
- writeInt
public void writeInt(int value) throws JMSException
Write an integer to the stream message.
- Parameters:
- value: the integer to be written.
- Throws:
- writeLong
public void writeLong(long value) throws JMSException
Write a long to the stream message.
- Parameters:
- value: the long to be written.
- Throws:
- writeObject
public void writeObject(java.lang.Object value) throws JMSException
Write a Java object to the stream message. This method works only for object primitive types (for example, Integer, Double, Long), strings, and byte arrays.
- Parameters:
- value: the Java object to be written.
- Throws:
- writeShort
public void writeShort(short value) throws JMSException
Write a short to the stream message.
- Parameters:
- value: the short to be written.
- Throws:
- writeString
public void writeString(java.lang.String value) throws JMSException
Write a string to the stream message.
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.