WebLogic Messaging API Class Library |

# IStreamMessage.ReadObject Method

Reads an object from the stream message.

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

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`.

object ReadObject();

#### Return Value

a object from the stream message

#### Exceptions

Exception Type | Condition
--- | ---
MessageException | if JMS fails to read the message due to some internal error.
MessageEOFException | if unexpected end of message stream has been reached.
MessageFormatException | if this type conversion is invalid.
MessageNotReadableException | if the message is in write-only mode.

#### See Also

IStreamMessage Interface | WebLogic.Messaging Namespace | ReadBytes