Closed chris-zen closed 8 years ago
I just realised that the Transit specs mandate to encode binary data as a base64 string. I don't really understand this decision, and makes me realise that using the MSGPACK format is not that much better than using the JSON one.
FYI, there is more discussion of this here: https://github.com/cognitect/transit-format/issues/2
When writing an array of bytes Transit uses the
BinaryWriteHandler
which gives theb
tag. Then for that tag, theAbstractEmitter
calls the functionemitBinary
. Its implementation inMsgpackEmitter
encodes the array of bytes as Base64 and emits an string as follows:Reading the specs of MessagePack I see that they have native support for encoding binary data without having to use strings encoded as Base64. I can understand this strategy for the JSON emitters but not for the Msgpack one.