code: public void flattenToBuffer(ByteBuffer buf) {
          ByteBuffer dup = m_buffer.duplicate();
          buf.putInt(dup.limit());
          dup.position(0);
          buf.put(dup);
      }
docs: <p>Serialize this table to a given ByteBuffer. Used mostly internally by VoltDB for
  moving tables over the network.</p>
  
  @param buf Buffer to serialize table to.