static Object parse(String text, int offset, int length, JSONReader.Feature... features) {
        if (text == null || text.isEmpty() || length == 0) {
            return null;
        }

        ObjectReaderProvider provider = JSONFactory.getDefaultObjectReaderProvider();
        final JSONReader.Context context = new JSONReader.Context(provider, features);
        ObjectReader<?> objectReader = provider.getObjectReader(Object.class, false);

        try (JSONReader reader = JSONReader.of(text, offset, length, context)) {
            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 string as a {@link JSONArray} or {@link JSONObject}.
Returns {@code null} if received {@link String} is {@code null} or empty or length is 0.

@param text the specified text to be parsed
@param offset the starting index of string
@param length the specified length of string
@param features the specified features is applied to parsing
@return either {@link JSONArray} or {@link JSONObject} or null
@throws JSONException If a parsing error occurs
core/src/main/java/com/alibaba/fastjson2/JSON.java