Reads an object from the stream message.

This method can be used to return, in objectified format, an object that has been written to the stream with the equivalent writeObject method call, or its equivalent primitive writetype method.

Note that byte values are returned as byte[], not Byte[].

An attempt to call readObject to read a byte field value into a new byte[] object before the full value of the byte field has been read will throw a MessageFormatException.

Namespace:  Kaazing.JMS
Assembly:  Kaazing.JMS (in Kaazing.JMS.dll)

Syntax

Visual Basic
Function ReadObject As Object
C#
Object ReadObject()
Visual C++
Object^ ReadObject()

Return Value

a object from the stream message, in objectified format (for example, if the object was written as an int, an Integer is returned)

Exceptions

ExceptionCondition
Kaazing.JMS..::..JMSExceptionif the JMS provider fails to read the message due to some internal error.
Kaazing.JMS..::..MessageEOFExceptionif unexpected end of message stream has been reached.
Kaazing.JMS..::..MessageFormatExceptionif this type conversion is invalid.
Kaazing.JMS..::..MessageNotReadableExceptionif the message is in write-only mode.

See Also

[!:ReadObjecteadBytes(byte[] value)]