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

Feature/raw contains string or data #3

Closed ChristianSteffens closed 9 years ago

ChristianSteffens commented 9 years ago

Previous MessagePack versions use type raw for sending string or binary data. The user itself has to decide if the data should be handled as a string or NSData. Your current MessagePack.swift implementation always assumes the new MessagePack Specification: String and Binary have their own types. For this reason I introduced a compatibility mode (MSGP_COMPATIBILITY_MODE).

Additional I fixed the length detection for unsigned integers and the new binary type.

a2 commented 9 years ago

What was wrong with the length detection for unsigned integers?

ChristianSteffens commented 9 years ago

Actually there´s nothing wrong with your implementation, my bad. I thought we had the same situation like in the previous pull request / wrong length detection for array 16 and array 32. I just tried it and it work´s perfectly.

But there´s still an issue with int64: The length should be 8 (bytes) and not 2 (bytes). And there´s the question regarding the MessagePack Compatibility mode.

Should we close this pull request and I'll make a new one?

a2 commented 9 years ago

Let's definitely tackle one problem per PR if that's okay.

ChristianSteffens commented 9 years ago

OK, I´ll close this one and made a new one.