With the core api, you just send byte messages (with aggregated properties).
You can just use ObjectOutputStream(ByteArrayOutputStream)
That's pretty much what we do on the JMS ObjectMessage wrapper.
(BTW: If JMS was being created today, I would fight against any other message type different than LargeMessages and BytesMessages ;-).. but that's a tangent of this conversation. All you need is a way to send Messages with aggregated bytes on it).