/**
* Test the construction from a stream.
*/
public void test_newFromStream() {
JSONArray jObject = null;
Exception ex = null;
// read in a basic JSON file of a toplevel array that has all the various types in it.
// Inputstreams are read as UTF-8 by the underlying parser.
try {
InputStream is = this.getClass().getClassLoader().getResourceAsStream("utf8_basic_array.json");
jObject = new JSONArray(is);
is.close();
} catch (Exception ex1) {
ex = ex1;
ex.printStackTrace();
}
assertTrue(jObject != null);
assertTrue(jObject.length() == 7);
assertTrue(ex == null);
}