private final long prevIndex;
- private final boolean isthisthefirsttimewerereadingthisgivenstream;
-
// ------------------------------------------------------------------------
// Constructors
// ------------------------------------------------------------------------
public StreamInputReader(StreamInput streamInput) {
this.streamInput = streamInput;
this.packetReader = new StreamInputPacketReader(this);
- this.isthisthefirsttimewerereadingthisgivenstream = true;
/*
* Get the iterator on the packet index.
*/
*/
public boolean readNextEvent() {
-
/*
* Change packet if needed
*/
}
return true;
}
- final StreamInputPacketIndexEntry currentPacket = this
- .getPacketReader().getCurrentPacket();
this.setCurrentEvent(null);
return false;
}
*/
goToNextPacket();
+ /*
+ * index up to the desired timestamp.
+ */
+ while ((this.packetReader.getCurrentPacket() != null)
+ && (this.packetReader.getCurrentPacket().getTimestampEnd() < timestamp)) {
+ try {
+ this.streamInput.addPacketHeaderIndex();
+ goToNextPacket();
+ } catch (CTFReaderException e) {
+ // do nothing here
+ }
+ }
+
/*
* Advance until A. we reached the end of the trace file (which means
* the given timestamp is after the last event), or B. we found the