public static boolean checkDataSize(String data, String dataName, int errorSize, boolean throwIfErr) {
        if (isBlank(data)) {
            return true;
        }
        int length = data.getBytes(StandardCharsets.UTF_8).length;
        if (length > errorSize) {
            LOGGER.warn("{} data is large(errorSize), size={}", dataName, length);
            if (!throwIfErr) {
                return false;
            }
            throw new IllegalArgumentException(dataName + " data is too large, size=" + length);
        }
        return true;
    }
@Test
    void checkDataSize() {
        assertThat(StringUtils.checkDataSize("","testdata",10,false)).isEqualTo(Boolean.TRUE);
        assertThat(StringUtils.checkDataSize("1234567","testdata",17,false)).isEqualTo(Boolean.TRUE);
        assertThat(StringUtils.checkDataSize("1234567","testdata",4,false)).isEqualTo(Boolean.FALSE);
        Assertions.assertThrows(IllegalArgumentException.class, () ->
                StringUtils.checkDataSize("1234567","testdata",6,true)
        );
        assertThat( StringUtils.checkDataSize("1234567","testdata",6,false)).isEqualTo(Boolean.FALSE);
    }