View Javadoc

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