static Object parse(InputStream in, JSONReader.Context context) {
        if (in == null) {
            return null;
        }

        ObjectReader<?> objectReader = context.getObjectReader(Object.class);
        try (JSONReaderUTF8 reader = new JSONReaderUTF8(context, in)) {
            Object object = objectReader.readObject(reader, null, null, 0);
            if (reader.ch != EOI && (context.features & IgnoreCheckClose.mask) == 0) {
                throw new JSONException(reader.info("input not end"));
            }
            return object;
        }
    }
Parses the json stream as a {@link JSONArray} or {@link JSONObject}.
Returns {@code null} if received {@link String} is {@code null} or empty.

@param in the specified stream to be parsed
@param context the specified custom context
@return either {@link JSONArray} or {@link JSONObject} or null
@throws JSONException If a parsing error occurs
@throws NullPointerException If received context is null
@since 2.0.47
core/src/main/java/com/alibaba/fastjson2/JSON.java