public static long getDataSize(Object object) {
        if (object == null) {
            return 0L;
        }
        long size;
        if (object instanceof BinaryRowData) {
            BinaryRowData binaryRowData = (BinaryRowData) object;
            size = binaryRowData.getSizeInBytes();
        } else {
            size = object.toString().getBytes(StandardCharsets.UTF_8).length;
        }
        return size;
    }
{@link BinaryRowData} don't implement the {@link Object#toString} method
So, we need use {@link BinaryRowData#getSizeInBytes} to get byte size.
inlong-sort/sort-flink/base/src/main/java/org/apache/inlong/sort/base/util/CalculateObjectSizeUtils.java