Skip to content

Commit 12696d0

Browse files
authored
Merge branch 'master' into develop
2 parents b3d6ec1 + 17c796f commit 12696d0

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

README.md

+54-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,63 @@ msgpack-smalltalk
33

44
MessagePack serialization library for various Smalltalk dialects.
55

6-
We are moving from [Google Code site](http://code.google.com/p/messagepack-st/). Old contents are still there.
6+
- Squeak
7+
- Pharo
8+
- VisualWorks
9+
- VA Smalltalk
10+
- Dolphin Smalltalk
11+
- GNU Smalltalk (Beta)
12+
- [Cuis](https://github.com/mumez/Cuis-Smalltalk-MessagePack)
713

8-
Currently, we have just put a [Cypress](https://github.com/CampSmalltalk/Cypress/blob/master/README.md)-based repository for the neutral accesses from various Smalltalk dialects.
14+
Sources are put as [Cypress](https://github.com/CampSmalltalk/Cypress/blob/master/README.md) for the neutral accesses from various Smalltalk dialects.
915

16+
## How to use ##
1017

18+
### Serialization ###
19+
```Smalltalk
20+
MpMessagePack pack: <your object>
21+
```
22+
or:
23+
```Smalltalk
24+
<your object> messagePacked
25+
```
26+
27+
### Deserialization ###
28+
```Smalltalk
29+
MpMessagePack unpack: msgpackBytes
30+
```
31+
or:
32+
```Smalltalk
33+
Object fromMessagePack: msgBytes
34+
```
35+
36+
### Samples ###
37+
38+
```Smalltalk
39+
map := Dictionary new.
40+
map at: 'someArray' asByteArray put: #(1 2.2 #[3 4 5]).
41+
packed := map messagePacked.
42+
(Object fromMessagePack: packed) inspect.
43+
```
44+
45+
```Smalltalk
46+
writeStream := WriteStream on: ByteArray new.
47+
encoder := MpEncoder on: writeStream.
48+
encoder nextPut: 1.
49+
encoder nextPut: #(2 3).
50+
dic := Dictionary new.
51+
dic at: 4 put: 5.
52+
encoder nextPut: dic.
53+
encoder nextPut: 'four' asByteArray.
54+
bytes := encoder contents.
55+
readStream := ReadStream on: bytes.
56+
decoder := MpDecoder on: readStream.
57+
[decoder atEnd] whileFalse: [
58+
Transcript cr; show: decoder next printString
59+
]
60+
```
61+
### How to install
62+
Please read [HowToInstall.md](<https://github.com/msgpack/msgpack-smalltalk/blob/master/doc/HowToInstall.md>).
1163

1264
### Loading the latest development version
1365

doc/HowToInstall.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ http://code.google.com/p/messagepack-st/source/browse/#hg%2FVA%20Smalltalk
5454

5555
## Dolphin Smalltalk:
5656

57-
Hosted on this site.
57+
Hosted on [Google Code site](<http://messagepack-st.googlecode.com>) (old version).
5858

5959
Zipped: [MessagePack-Dolphin.zip](http://messagepack-st.googlecode.com/hg/Dolphin%20Smalltalk/MessagePack-Dolphin.zip).
6060
Sources: [MessagePack](http://code.google.com/p/messagepack-st/source/browse/#hg%2FDolphin%20Smalltalk%2FMessagePack).

0 commit comments

Comments
 (0)