for (int i=0; i < 256; i++) {
content[i] = (byte)i;
}
msg.writeBytes(content, 0, content.length);
XBDestination dest = new XBDestination("someTopic", null);
msg.setJMSDestination(dest);
msg.reset();
byte[] content2 = new byte[256];
msg.readBytes(content2);
for (int i=0; i < content.length; i++)
assertEquals("byte nr. '" + i + "' is wrong", content[i], content2[i]);
}
{ // 1. key, content and qos all null in constructor
byte[] content = null;
XBBytesMessage msg = new XBBytesMessage(null, content);
content = new byte[256];
for (int i=0; i < 256; i++) {
content[i] = (byte)i;
}
msg.writeBytes(content, 0, content.length);
XBDestination dest = new XBDestination("someTopic", null);
msg.setJMSDestination(dest);
msg.reset();
MsgUnit msgUnit = MessageHelper.convertToMessageUnit(new Global(), msg);
byte[] content2 = msgUnit.getContent();