View Javadoc

1   package org.lcsim.lcio;
2   
3   import hep.io.sio.SIOInputStream;
4   import hep.io.sio.SIOOutputStream;
5   import java.io.IOException;
6   
7   import org.lcsim.event.Cluster;
8   
9   /**
10   *
11   * @author tonyj
12   */
13  class SIOClusterBlockHandler extends AbstractBlockHandler
14  {
15     public String getType() { return "Cluster"; }
16     public Class getClassForType() { return Cluster.class; }
17     LCIOCallback addCollectionElements(LCIOEvent event, LCIOCollection collection, SIOInputStream in, int n, int version) throws IOException
18     {
19        for (int i = 0; i < n; i++)
20           collection.add(new SIOCluster(in, collection.getFlags(), version));
21        return null;
22     }
23     
24     void writeCollectionElement(Object element, SIOOutputStream out, int flags) throws IOException
25     {
26        SIOCluster.write((Cluster) element, out, flags);
27     }
28  }