static JSONArray parseArray(InputStream in, Charset charset, JSONReader.Context context) {
        if (in == null) {
            return null;
        }

        try (JSONReader reader = JSONReader.of(in, charset, context)) {
            if (reader.nextIfNull()) {
                return null;
            }
            JSONArray array = new JSONArray();
            reader.read(array);
            if (reader.resolveTasks != null) {
                reader.handleResolveTasks(array);
            }
            if (reader.ch != EOI && (context.features & IgnoreCheckClose.mask) == 0) {
                throw new JSONException(reader.info("input not end"));
            }
            return array;
        }
    }
Parses the json stream as a {@link JSONArray}. Returns {@code null}
if received {@link InputStream} is {@code null} or its content is null.

@param in the specified stream to be parsed
@param charset the specified charset of the stream
@param context the specified custom context
@return {@link JSONArray} or {@code null}
@throws JSONException If an I/O error or parsing error occurs
core/src/main/java/com/alibaba/fastjson2/JSON.java