Skip to content

Commit 58808f4

Browse files
committed
Documents are imported from google code wiki (http://code.google.com/p/messagepack-st/).
1 parent bd93407 commit 58808f4

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

doc/HowToInstall.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## How to install
2+
3+
### Squeak:
4+
5+
Hosted on SqueakSource Repository.
6+
(http://www.squeaksource.com/MessagePack.html).
7+
8+
From Monticello:
9+
```
10+
MCHttpRepository
11+
location: 'http://www.squeaksource.com/MessagePack'
12+
user: ''
13+
password: ''
14+
```
15+
16+
You can also use Installer:
17+
```
18+
Installer squeaksource
19+
project: 'MetacelloRepository';
20+
install: 'ConfigurationOfMessagePack'.
21+
(Smalltalk at: #ConfigurationOfMessagePack) perform: #load.
22+
```
23+
### Pharo:
24+
You can use Gofer:
25+
```
26+
Gofer it
27+
squeaksource3: 'MessagePack';
28+
package: 'ConfigurationOfMessagePack';
29+
load.
30+
(Smalltalk at: #ConfigurationOfMessagePack) perform: #load.
31+
```
32+
### VisualWorks:
33+
34+
Hosted on [Public Store Repository](http://www.cincomsmalltalk.com/CincomSmalltalkWiki/PostgreSQL+Access+Page).
35+
http://www.cincomsmalltalk.com/publicRepository/MessagePack-All(Bundle).html
36+
37+
You can also download parcels:
38+
http://code.google.com/p/messagepack-st/source/browse/#hg%2FVisualWorks
39+
40+
### VA Smalltalk:
41+
42+
Hosted on [VAStGoodies.com](http://vastgoodies.com).
43+
44+
Core: [MessagePack](http://vastgoodies.com/maps/MessagePack).
45+
Tests: [MessagePackTests](http://vastgoodies.com/maps/MessagePack%20Tests).
46+
47+
You can also download .dat files:
48+
http://code.google.com/p/messagepack-st/source/browse/#hg%2FVA%20Smalltalk
49+
50+
### Dolphin Smalltalk:
51+
52+
Hosted on this site.
53+
54+
Zipped: [MessagePack-Dolphin.zip](http://messagepack-st.googlecode.com/hg/Dolphin%20Smalltalk/MessagePack-Dolphin.zip).
55+
Sources: [MessagePack](http://code.google.com/p/messagepack-st/source/browse/#hg%2FDolphin%20Smalltalk%2FMessagePack).
56+
57+
Download the zipped pac file: MessagePack-Dolphin.zip and follow the instruction on README file.

doc/HowToUse.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
### Serialization:
2+
```
3+
MpMessagePack pack: <your object>
4+
```
5+
6+
or:
7+
8+
```
9+
<your object> messagePacked
10+
```
11+
12+
### Deserialization:
13+
```
14+
MpMessagePack unpack: msgpackBytes
15+
```
16+
17+
or:
18+
19+
```
20+
Object fromMessagePack: msgBytes
21+
```
22+
23+
### Sample1:
24+
```
25+
map := Dictionary new.
26+
map at: 'someArray' asByteArray put: #(1 2.2 #[3 4 5]).
27+
packed := map messagePacked.
28+
(Object fromMessagePack: packed) inspect.
29+
```
30+
31+
### Sample2:
32+
```
33+
writeStream := WriteStream on: ByteArray new.
34+
encoder := MpEncoder on: writeStream.
35+
encoder nextPut: 1.
36+
encoder nextPut: #(2 3).
37+
dic := Dictionary new.
38+
dic at: 4 put: 5.
39+
encoder nextPut: dic.
40+
encoder nextPut: 'four' asByteArray.
41+
bytes := encoder contents.
42+
43+
readStream := ReadStream on: bytes.
44+
decoder := MpDecoder on: readStream.
45+
[decoder atEnd] whileFalse: [
46+
Transcript cr; show: decoder next printString
47+
]
48+
49+
```

0 commit comments

Comments
 (0)