private MessageImpl convertStreamMessage(final StreamMessage message) throws JMSException { StreamMessageImpl streamMessage = createStreamMessage(); try { message.reset(); while (true) { streamMessage.writeObject(message.readObject()); } } catch (MessageEOFException e) { // we're at the end so don't mind the exception } return streamMessage; }
public void reset() throws JMSException { ((StreamMessage) message).reset(); }