Reads an object from the stream message.
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 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
.
@return a Java object from the stream message, in objectifiedformat (for example, if the object was written as an int
, an Integer
is returned)
@throws JMSException if the JMS provider fails to read the messagedue to some internal error.
@throws MessageEOFException if unexpected end of message stream hasbeen reached.
@throws MessageFormatException if this type conversion is invalid.
@throws MessageNotReadableException if the message is in write-onlymode.
@see #readBytes(byte[] value)