@@ -0,0 +1,1810 @@
+/* This file is part of VoltDB.%0A * Copyright (C) 2008-2013 VoltDB Inc.%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as%0A * published by the Free Software Foundation, either version 3 of the%0A * License, or (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with VoltDB.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A%0Apackage org.voltdb.sysprocs.saverestore;%0A%0Aimport org.voltcore.utils.DBBPool;%0A%0Aimport java.nio.ByteBuffer;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * A helper class to encapsulate the serialization of snapshot output buffers%0A */%0Apublic class SnapshotOutputBuffers %7B%0A    private final List%3CDBBPool.BBContainer%3E m_containers = new ArrayList%3CDBBPool.BBContainer%3E();%0A%0A    public void addContainer(DBBPool.BBContainer container)%0A    %7B%0A        m_containers.add(container);%0A    %7D%0A%0A    public List%3CDBBPool.BBContainer%3E getContainers()%0A    %7B%0A        return m_containers;%0A    %7D%0A%0A    public byte%5B%5D toBytes()%0A    %7B%0A        ByteBuffer buf = ByteBuffer.allocate(4 + // buffer count%0A                                             (8 + 4 + 4) * m_containers.size()); // buffer info%0A%0A        buf.putInt(m_containers.size());%0A        for (DBBPool.BBContainer container : m_containers) %7B%0A            buf.putLong(container.address);%0A            buf.putInt(container.b.position());%0A            buf.putInt(container.b.remaining());%0A        %7D%0A%0A        return buf.array();%0A    %7D%0A%7D%0A

Add a helper class to encapsulate serialization of multiple snapshot buffers to EE.