juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Bognar <james.bog...@salesforce.com>
Subject MessagePack support. More flexibility on input and output types.
Date Tue, 28 Jun 2016 01:36:16 GMT
FYI....

I just delivered full serialization and parsing support for MessagePack (
https://en.wikipedia.org/wiki/MessagePack).  The marshalled output has a
considerably smaller footprint than JSON.  Since it's analogous to JSON, it
was pretty simple creating serializers and parsers for it.

Subclasses of RestServletDefault will also automatically support
MessagePack.

I made modifications to the low-level Serializer and Parser APIs so that
there's better consistency between byte and character based marshalling.
There's no high-level differences, but the biggest thing you may notice is
that I got rid of the type parameters from the Serializer and Parser
classes.  I think it looks a lot cleaner now.

The 1-arg convenience serialize methods will return a String for
character-based serializers and byte[] for stream-based serializers.  e.g...
String json = JsonSerializer.DEFAULT.serialize(pojo);
byte[] msgPack = MsgPackSerialzier.DEFAULT.serialize(pojo);

Also, the input and output types are more flexible now....
 - Character-based serializers can serialize to: Writer, OutputStream, File.
 - Stream-based serializers can serialize to any of the following:
OutputStream, File.
 - Character-based parsers can parse from:  Reader, CharSequence,
InputStream, File.
 - Stream-based parsers can parse from: InputStream, byte[], File.

Note that these changes exist in only the GitHub repo for now.

-- 
James Bognar

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message