a2 / MessagePack.swift

It's like JSON, but fast and small…and Swift! – msgpack.org[Swift]
http://msgpack.org
MIT License
283 stars 60 forks source link

Permit 0 sized binary #69

Closed jarrodmoldrich closed 5 years ago

jarrodmoldrich commented 5 years ago

Hello @a2 ,

Recently came across an incompatibility with msgpack-java. I was encoding a binary array with variable size (0..n), and unpacking was throwing an exception for the 0 size case. There's no explicit restriction in the spec that would forbid a 0 size binary, and both this library and the Java library will happily pack a zero-sized binary. So I removed the assertion and added some basic tests.

This solves my problem, but it would be good to see this hit upstream. Let me know what you think.

Cheers,

Jarrod

jarrodmoldrich commented 5 years ago

@a2 Thanks for merging that so quickly. Might it be possible to tag a new release? It looks a bit nicer in the Cartfile :)