presto-thrift-api/src/main/java/io/prestosql/plugin/thrift/api/datatypes/PrestoThriftTypeUtils.java/PrestoThriftTypeUtils/totalSize
class PrestoThriftTypeUtils:    public static int totalSize(boolean[] nulls, int[] sizes)
    {
        int numberOfRecords;
        if (nulls != null) {
            numberOfRecords = nulls.length;
        }
        else if (sizes != null) {
            numberOfRecords = sizes.length;
        }
        else {
            numberOfRecords = 0;
        }
        int total = 0;
        for (int i = 0; i < numberOfRecords; i++) {
            if (nulls == null || !nulls[i]) {
                total += sizes[i];
            }
        }
        return total;
    }