- readBoolean
-
public boolean readBoolean() throws JMSException
Read a boolean from the stream message.
- Returns:
- the boolean value read.
- Throws:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream is received.
- MessageFormatException - if this type conversion is not valid.
- MessageNotReadableException - if the message is in write-only mode.
- 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:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream is received.
- MessageFormatException - if this type conversion is not valid.
- MessageNotReadableException - if the message is in write-only mode.
- 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 will throw 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:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream is received.
- MessageFormatException - if this type conversion is not valid.
- MessageNotReadableException - if the message is in write-only mode.
- readChar
-
public char readChar() throws JMSException
Read a Unicode character value from the stream message.
- Returns:
- a Unicode character from the stream message.
- Throws:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream is received.
- MessageFormatException if this type conversion is not valid.
- MessageNotReadableException if the message is in write-only mode.
- readDouble
-
public double readDouble() throws JMSException
Read a double from the stream message.
- Returns:
- a double value from the stream message.
- Throws:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream is received.
- MessageFormatException - if this type conversion is not valid.
- MessageNotReadableException - if the message is in write-only mode.
- readFloat
-
public float readFloat() throws JMSException
Read a float from the stream message.
- Returns:
- a float value from the stream message.
- Throws:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream
- MessageFormatException if this type conversion is not valid.
- MessageNotReadableException - if the message is in write-only mode.
- 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:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream is received.
- MessageFormatException if this type conversion is not valid.
- MessageNotReadableException if the message is in write-only mode.
- 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:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream
- MessageFormatException if this type conversion is not valid.
- MessageNotReadableException if the message is in write-only mode.
- 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:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream is received.
- NotReadableException - if the message is in write-only mode.
- 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:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream is received.
- MessageFormatException - if this type conversion is not valid.
- MessageNotReadableException - if the message is in write-only mode.
- 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:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageEOFException - if an end of message stream is received.
- MessageFormatException - if this type conversion is not valid.
- MessageNotReadableException - if the message is in write-only mode
- reset
-
public void reset() throws JMSException
Put the message in read-only mode, and reposition the stream to the
beginning.
- Throws:
-
- JMSException - if JMS fails to reset the message because of an internal
JMS error.
- MessageFormatException - if the message has an not valid format.
- writeBoolean
-
public void writeBoolean(boolean value) throws JMSException
Write a boolean to the stream message.
- Parameters:
- value - the boolean value to be written.
- Throws:
-
- JMSException - if JMS fails to read the message because of an internal JMS
error.
- MessageNotWriteableException - if the message is in read-only mode.
- writeByte
-
public void writeByte(byte value) throws JMSException
Write out a byte to the stream message.
- Parameters:
- value - the byte value to be written.
- Throws:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.
- 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:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.
- 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:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.
- writeChar
-
public void writeChar(char value) throws JMSException
Write a char to the stream message.
- Parameters:
- value - the char value to be written.
- Throws:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.
- writeDouble
-
public void writeDouble(double value) throws JMSException
Write a double to the stream message.
- Parameters:
- value - the double value to be written.
- Throws:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.
- writeFloat
-
public void writeFloat(float value) throws JMSException
Write a float to the stream message.
- Parameters:
- value - the float value to be written.
- Throws:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.
- writeInt
-
public void writeInt(int value) throws JMSException
Write an int to the stream message.
- Parameters:
- value - the int to be written.
- Throws:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.
- writeLong
-
public void writeLong(long value) throws JMSException
Write a long to the stream message.
- Parameters:
- value - the long to be written.
- Throws:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.
- writeObject
-
public void writeObject(java.lang.Object value)
throws JMSException
Write a Java object to the stream message. This method only works
for object primitive types (Integer, Double, Long, for example), Strings, and
byte arrays.
- Parameters:
- value - the Java object to be written.
- Throws:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.
- MessageFormatException - if the object is not valid.
- writeShort
-
public void writeShort(short value) throws JMSException
Write a short to the stream message.
- Parameters:
- value - the short to be written.
- Throws:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.
- writeString
-
public void writeString(java.lang.String value)
throws JMSException
Write a string to the stream message.
- Parameters:
- value - the String value to be written.
- Throws:
-
- JMSException - if JMS fails to write the message because of an internal
JMS error.
- MessageNotWriteableException - if the message is in read-only mode.