jnetpcap.capture
Interface MutableFileIterator

All Superinterfaces:
FileIterator
All Known Subinterfaces:
MutableFileCapture, PcapFile, SnoopFile

public interface MutableFileIterator
extends FileIterator

Extends the immutable FileIterator and adds methods to add, remove, move or seek around the underlying packet dataset.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Method Summary
 SeekResult seek(java.sql.Timestamp earliestTimestamp)
          Seeks or searches for the first paket within the iterator starting at the beggining, that has its capture timestamp equal or older then the specified timestamp.
 void setPosition(long position)
          Sets the absolute position of this iterator's current position.
 
Methods inherited from interface jnetpcap.capture.FileIterator
getPosition
 

Method Detail

setPosition

void setPosition(long position)
                 throws java.io.IOException
Sets the absolute position of this iterator's current position. The position is not aligned or checked against valid elements starting at the specified position. Therefore if the position is not properly aligned with the start of a element, any future method calls to access elements will fail with IOException potentially being thrown.

Parameters:
position - new absolute position of the current pointer within the file
Throws:
java.io.IOException - any IO errors

seek

SeekResult seek(java.sql.Timestamp earliestTimestamp)
                throws java.io.IOException
Seeks or searches for the first paket within the iterator starting at the beggining, that has its capture timestamp equal or older then the specified timestamp. Another words, the iterator will be positioned at the packet with the timestamp closest to this user supplied earliestTimestamp but not before this timestamp.

Parameters:
earliestTimestamp - earliest timestamp to search for
Returns:
the status of the seek
Throws:
java.io.IOException - any IO errors