The table below lists the type conversion rules for reading a message property or a field from the message body of message types MapMessage and StreamMessage.
Any message property, map message key value or byte message field written as one of the types in the row can be read out as one of the types of the columns for which the cells are marked as Y. All the other cases will throw a JMSException. Please note that the cases for char and byte[] are not applicable for message properties. When a string is read as one of the primitives if the string value cannot be converted to the required type an appropriate instance of NumberFormatException will be thrown:
boolean | byte | byte[ ] | short | char | int | long | float | double | String | |
---|---|---|---|---|---|---|---|---|---|---|
boolen | Y | Y | ||||||||
byte | Y | Y | Y | Y | Y | |||||
byte[ ] | Y | |||||||||
short | Y | Y | Y | Y | ||||||
char | Y | Y | ||||||||
int | Y | Y | Y | |||||||
long | Y | Y | ||||||||
float | Y | Y | Y | |||||||
double | Y | Y | ||||||||
String | Y | Y | Y | Y | Y | Y | Y | Y |