@@ -13,7 +13,7 @@ Simply supply the following command line parameter:```-Dfile.encoding=UTF8```
1313
1414Dependencies
1515------------
16- The library is available on JCenter. The latest version is 1.1 .0
16+ The library is available on JCenter. The latest version is 1.2 .0
1717
1818Replace ``` {LATEST_VERSION} ``` with the latest version.
1919
@@ -37,30 +37,37 @@ Tutorial
3737** Converting an input stream to UTF-8 JSON**
3838``` java
3939try {
40- JSONObject json = JsonIO . toJSON(inputStream);
41- } catch (IOException e) {}
40+ JSONObject json = JsonIO . toJson(inputStream);
41+ } catch (JsonIOException e) {}
42+ ```
43+
44+ ** Converting an input stream to UTF-8 JSON array**
45+ ``` java
46+ try {
47+ JSONArray jsonArray = JsonIO . toJsonArray(inputStream);
48+ } catch (JsonIOException e) {}
4249```
4350
4451** Converting a file to UTF-8 JSON**
4552``` java
4653try {
47- JSONObject json = JsonIO . toJSON (new File (" sample_json.json" ));
48- } catch (IOException e) {}
54+ JSONObject json = JsonIO . toJson (new File (" sample_json.json" ));
55+ } catch (JsonIOException e) {}
4956```
5057
5158** Converting a string to UTF-8 JSON**
5259``` java
5360try {
54- JSONObject json = JsonIO . toJSON (" {" text" : " Some text" }" );
55- } catch (IOException e) {}
61+ JSONObject json = JsonIO . toJson (" {" text" : " Some text" }" );
62+ } catch (JsonIOException e) {}
5663```
5764
5865** Converting JSON to file**
5966``` java
6067JSONObject json = some JSON ;
6168try {
6269 JsonIO . toFile(json, new File (" output.json" ));
63- } catch (IOException e) {}
70+ } catch (JsonIOException e) {}
6471```
6572
6673** Converting JSON to file (append to a file)**
@@ -69,15 +76,15 @@ JSONObject json = some JSON;
6976try {
7077 JsonIO . toFile(json, new File (" output.json" ), true );
7178}
72- catch (IOException e) {}
79+ catch (JsonIOException e) {}
7380```
7481
7582** Converting JSON to a UTF-8 string**
7683``` java
7784JSONObject json = some JSON ;
7885try {
7986 String jsonString = JsonIO . toString(json);
80- } catch (IOException e) {}
87+ } catch (JsonIOException e) {}
8188```
8289
8390License
0 commit comments