static JSONObject parseObject(byte[] bytes, int offset, int length, JSONReader.Feature... features) {
        if (bytes == null || bytes.length == 0 || length == 0) {
            return null;
        }

        final JSONReader.Context context = JSONFactory.createReadContext(features);
        try (JSONReader reader = JSONReader.of(bytes, offset, length, context)) {
            if (reader.nextIfNull()) {
                return null;
            }
            JSONObject object = new JSONObject();
            reader.read(object, 0);
            if (reader.resolveTasks != null) {
                reader.handleResolveTasks(object);
            }
            if (reader.ch != EOI && (context.features & IgnoreCheckClose.mask) == 0) {
                throw new JSONException(reader.info("input not end"));
            }
            return object;
        }
    }
Parses the json byte array as a {@link JSONObject}. Returns {@code null} if
received byte array is {@code null} or empty or length is 0 or its content is null.

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