I'm working on a low-level UDP messaging layer for an encrypted P2P architecture, if interested you can read more about it on its github page.
I've built a neat serialization framework that turns POJOs into compact ByteBuffers, and also various libraries that make using symmetric and asymmetric crypto fairly painless.
I'm now working on the messaging framework, which makes use of dynamic proxies to achieve similar functionality to GWT's RPC mechanism.
My problem is that early-on I decided to make the serialization mechanism read to and write from ByteBuffers. I'm now finding that this has several problems:
- You need to know the maximum bytebuffer size in advance of serializing an object
- They are mutable which makes them error-prone
- They aren't especially compatible with DatagramPacket, and DatagramChannels are confusing
Can anyone suggest alternative ways to implement serialization in this framework?