MCPcopy Index your code
hub / github.com/benfry/processing4 / loadJSONArray

Method loadJSONArray

core/src/processing/core/PApplet.java:5485–5498  ·  view source on GitHub ↗

Loads an array of JSON objects from the data folder or a URL, and returns a JSONArray . Per standard JSON syntax, the array must be enclosed in a pair of hard brackets [] , and each object within the array must be separated by a comma. All files loaded and saved by the Proce

(String filename)

Source from the content-addressed store, hash-verified

5483 * @see PApplet#saveJSONArray(JSONArray, String)
5484 */
5485 public JSONArray loadJSONArray(String filename) {
5486 // can't pass of createReader() to the constructor b/c of resource leak
5487 BufferedReader reader = createReader(filename);
5488 if (reader != null) {
5489 JSONArray outgoing = new JSONArray(reader);
5490 try {
5491 reader.close();
5492 } catch (IOException e) { // not sure what would cause this
5493 e.printStackTrace();
5494 }
5495 return outgoing;
5496 }
5497 return null;
5498 }
5499
5500
5501 static public JSONArray loadJSONArray(File file) {

Callers 1

loadMethod · 0.95

Calls 3

createReaderMethod · 0.95
closeMethod · 0.45
printStackTraceMethod · 0.45

Tested by

no test coverage detected