presto-main/src/main/java/io/prestosql/execution/buffer/PagesSerdeUtil.java/PagesSerdeUtil/writeSerializedPages
class PagesSerdeUtil:    public static long writeSerializedPages(SliceOutput sliceOutput, Iterable<SerializedPage> pages)
    {
        Iterator<SerializedPage> pageIterator = pages.iterator();
        long size = 0;
        while (pageIterator.hasNext()) {
            SerializedPage page = pageIterator.next();
            writeSerializedPage(sliceOutput, page);
            size += page.getSizeInBytes();
        }
        return size;
    }