@SuppressWarnings("unchecked")
    static <T> T parseObject(
            byte[] bytes,
            Class<T> clazz,
            JSONReader.Context context
    ) {
        if (bytes == null || bytes.length == 0) {
            return null;
        }

        boolean fieldBased = (context.features & JSONReader.Feature.FieldBased.mask) != 0;
        final ObjectReader<T> objectReader = context.provider.getObjectReader(clazz, fieldBased);

        try (JSONReader reader = JSONReader.of(bytes, context)) {
            T object = objectReader.readObject(reader, clazz, null, 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 {@link T}. Returns
{@code null} if received byte array is {@code null} or empty.

@param bytes the specified UTF8 text to be parsed
@param clazz the specified class of {@link T}
@param context the specified custom context
@return {@link T} or {@code null}
@throws JSONException If a parsing error occurs
@throws NullPointerException If received context is null
core/src/main/java/com/alibaba/fastjson2/JSON.java