presto-thrift-api/src/main/java/io/prestosql/plugin/thrift/api/datatypes/SliceData.java/SliceData/totalSliceBytes
class SliceData:    private static int totalSliceBytes(Block block)
    {
        int totalBytes = 0;
        int positions = block.getPositionCount();
        for (int position = 0; position < positions; position++) {
            totalBytes += block.getSliceLength(position);
        }
        return totalBytes;
    }