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   import org.lcsim.event.ReconstructedParticle;
7   
8   /**
9    *
10   * @author tonyj
11   */
12  class SIOReconstructedParticleBlockHandler extends AbstractBlockHandler
13  {
14     public String getType() { return "ReconstructedParticle"; }
15     public Class getClassForType() { return ReconstructedParticle.class; }
16     LCIOCallback addCollectionElements(LCIOEvent event, LCIOCollection collection, SIOInputStream in, int n, int version) throws IOException
17     {
18        for (int i = 0; i < n; i++)
19           collection.add(new SIOReconstructedParticle(in, collection.getFlags(), version));
20        return null;
21     }
22     
23     void writeCollectionElement(Object element, SIOOutputStream out, int flags) throws IOException
24     {
25        SIOReconstructedParticle.write((ReconstructedParticle) element, out, flags);
26     }
27  }