static boolean isValid(byte[] bytes) {
        if (bytes == null || bytes.length == 0) {
            return false;
        }

        try (JSONReader jsonReader = JSONReader.of(bytes)) {
            jsonReader.skipValue();
            return jsonReader.isEnd() && !jsonReader.comma;
        } catch (JSONException | ArrayIndexOutOfBoundsException error) {
            return false;
        }
    }
Verify that the json byte array is legal json text

@param bytes the specified array will be validated
@return {@code true} or {@code false}
core/src/main/java/com/alibaba/fastjson2/JSON.java