Skip to content

Commit 531b7ea

Browse files
committed
update README
1 parent 367dde2 commit 531b7ea

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,50 @@ jsoniter (json-iterator) is fast and flexible JSON parser available in [Java](ht
66
* Having a developer friendly api is our #1 prioprity, you can choose from bind-api, any-api or iterator-api or all of them (checkout your [api choices](http://jsoniter.com/api.html))
77
* Unique iterator api can iterate through JSON directly, zero memory allocation! (see how [iterator](http://jsoniter.com/api.html#iterator-api) works)
88

9-
Join us [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)
9+
# 1 Minute Tutorial
10+
11+
Given this JSON document `[0,1,2,3]`
12+
13+
Parse with Java bind-api
14+
15+
```java
16+
import com.jsoniter.Jsoniter;
17+
Jsoniter iter = Jsoniter.parse("[0,1,2,3]");
18+
int[] val = iter.read(int[].class);
19+
System.out.println(val[3]);
20+
```
21+
22+
Parse with Java any-api
23+
24+
```java
25+
import com.jsoniter.Jsoniter;
26+
Jsoniter iter = Jsoniter.parse("[0,1,2,3]");
27+
Any val = iter.readAny();
28+
System.out.println(any.get(3));
29+
```
30+
31+
Parse with Java iterator-api
32+
33+
```java
34+
import com.jsoniter.Jsoniter;
35+
Jsoniter iter = Jsoniter.parse("[0,1,2,3]");
36+
int total = 0;
37+
while(iter.readArray()) {
38+
total += iter.readInt();
39+
}
40+
System.out.println(total);
41+
```
42+
43+
# How to get
44+
45+
```
46+
<dependency>
47+
<groupId>com.jsoniter</groupId>
48+
<artifactId>jsoniter</artifactId>
49+
<version>0.9.1</version>
50+
</dependency>
51+
```
52+
53+
# Contribution Welcomed !
54+
55+
Report issue or pull request, or email taowen@gmail.com, or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby)

0 commit comments

Comments
 (0)