Hacker News new | ask | show | jobs
by kentonv 4698 days ago
The name makes me thing of CAP'N CRUNCH CEREAL... Might want to think of a different name

But... It's a cerealization protocol. :P

If I wanted to use this for Java, wouldn't there still be decode step to convert the fields into java objects?

Not necessarily. Your generated Java object could just contain a (ByteBuffer, int offset) pair. All the getter/setter methods then just write through to the underlying ByteBuffer.

1 comments

http://docs.oracle.com/javase/1.4.2/docs/api/java/nio/ByteBu... is solid enough reading for the interested in encoding/decoding. It compares Direct v.s. non-direct buffers. The doc does remain somewhat circumspect about whether any work is done converting from raw memory to primitive values, for example in the use of getLong or putLong to read or write.