1 45 46 package org.exolab.jms.message; 47 48 import javax.jms.BytesMessage ; 49 import javax.jms.JMSException ; 50 import javax.jms.Message ; 51 52 53 60 class BytesMessageConverter extends AbstractMessageConverter { 61 62 68 protected Message create() throws JMSException { 69 return new BytesMessageImpl(); 70 } 71 72 79 protected void populate(Message source, Message target) 80 throws JMSException { 81 byte[] buffer = new byte[512]; 82 BytesMessage from = (BytesMessage ) source; 83 BytesMessage to = (BytesMessage ) target; 84 85 super.populate(from, to); 87 88 from.reset(); int count; 91 while ((count = from.readBytes(buffer)) != -1) { 92 to.writeBytes(buffer, 0, count); 93 } 94 } 95 } 96 | Popular Tags |