* @param target the message to populate
* @throws JMSException for any error
*/
protected void populate(Message source, Message target)
throws JMSException {
StreamMessage from = (StreamMessage) source;
StreamMessage to = (StreamMessage) target;
// populate header
super.populate(from, to);
// populate body
from.reset(); // make sure the message can be read
try {
while (true) {
Object object = from.readObject();
to.writeObject(object);
}
} catch (MessageEOFException ignore) {
// all done
}
}