MessagePack serialization library for various Smalltalk dialects.
- Squeak
- Pharo
- VisualWorks
- VA Smalltalk
- Dolphin Smalltalk
- GNU Smalltalk (Beta)
- Cuis
Sources are put as Cypress for the neutral accesses from various Smalltalk dialects.
MpMessagePackpack:<your object>or:
<your object> messagePackedMpMessagePackunpack: msgpackBytesor:
ObjectfromMessagePack: msgBytesmap :=Dictionarynew.
map at:'someArray' asByteArray put:#(1 2.2 #[3 4 5]).
packed := map messagePacked.
(ObjectfromMessagePack: packed) inspect.writeStream :=WriteStreamon:ByteArraynew.
encoder :=MpEncoderon: writeStream.
encoder nextPut:1.
encoder nextPut:#(2 3).
dic :=Dictionarynew.
dic at:4put:5.
encoder nextPut: dic.
encoder nextPut:'four' asByteArray.
bytes := encoder contents.
readStream :=ReadStreamon: bytes.
decoder :=MpDecoderon: readStream.
[decoder atEnd] whileFalse: [
Transcript cr; show: decoder next printString
]Please read HowToInstall.md.
Installer squeaksource
project:'MessagePack';
install:'ConfigurationOfMessagePack'. (Smalltalkat:#ConfigurationOfMessagePack) project development loadMetacellonewbaseline:'MessagePack';
repository:'github://msgpack/msgpack-smalltalk:develop/repository';
load.You might need MpTypeMapper initializeAll on new encoder/decoder-related updates.
Starting with Squeak 5 and 6, DateAndTime only supports microsecond precision. Because of this, nanosecond values are not properly decoded as DateAndTime. Two unit tests (testPackUnpackTimestamp64, 96) fail on Squeak 5 and 6.