expected.setMessage(new Buffer(new byte[] {1,2,3,4,5,6} ));
expected.setMessageId("Hello World");
int size = expected.serializedSizeFramed();
DataByteArrayOutputStream os = new DataByteArrayOutputStream(size + 1);
os.writeByte(expected.type().getNumber());
expected.writeFramed(os);
ByteSequence seq = os.toByteSequence();
DataByteArrayInputStream is = new DataByteArrayInputStream(seq);
KahaEntryType type = KahaEntryType.valueOf(is.readByte());