gov.nasa.gsfc.drl.rtstps.core.output.hdf5
Class SequentialPacketReader
java.lang.Object
gov.nasa.gsfc.drl.rtstps.core.output.hdf5.SequentialPacketReader
- All Implemented Interfaces:
- java.util.Iterator<PacketI>
public class SequentialPacketReader
- extends java.lang.Object
- implements java.util.Iterator<PacketI>
Using the StaticHeader of a particular RawApplicationPackets item, read the contents using a sequential access style interface.
This class simply indexes into the StaticHeader packet region and read each packet in a sequential manner.
Note that this classes constructor is package private, and a method in each StaticHeader must be used
to create it.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
factory
private PacketFactoryI factory
data
private byte[] data
index
private int index
SequentialPacketReader
SequentialPacketReader(PacketFactoryI factory,
StaticHeader staticHeader)
- Make a new reader by providing PacketFactory (some way to create new Packets) and the
StaticHeader of interest
- Parameters:
packetFactory
- a way to create new PacketsstaticHeader
- the StaticHeader from a RawApplicationsPackets of interest
getIndex
public int getIndex()
getDataLength
public int getDataLength()
next
public PacketI next()
- Return a Packet constructed from an index into the buffer
- Specified by:
next
in interface java.util.Iterator<PacketI>
- Returns:
- the next Packet
hasNext
public boolean hasNext()
- Return true or false if another packet is available
- Specified by:
hasNext
in interface java.util.Iterator<PacketI>
remove
public void remove()
- Specified by:
remove
in interface java.util.Iterator<PacketI>
getAppID
private int getAppID()
getPacketLength
private int getPacketLength()
getPacketSize
private int getPacketSize()