com.voytechs.jnetstream.io
Class DefaultPacketCounter
java.lang.Object
com.slytechs.jnetstream.file.PacketCounter
com.voytechs.jnetstream.io.DefaultPacketCounter
public class DefaultPacketCounter
- extends PacketCounter
- Author:
- Mark Bednarczyk, Sly Technologies, Inc.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultPacketCounter
public DefaultPacketCounter(java.io.File file,
PacketCounterModel model)
throws java.io.FileNotFoundException,
StreamFormatException
- Throws:
java.io.UnsupportedEncodingException
StreamFormatException
java.io.FileNotFoundException
DefaultPacketCounter
public DefaultPacketCounter(java.io.File file)
throws java.io.FileNotFoundException,
StreamFormatException
- Parameters:
file -
- Throws:
java.io.UnsupportedEncodingException
StreamFormatException
java.io.FileNotFoundException
validateModel
public PacketCounterModel validateModel(java.io.File file,
PacketCounterModel model)
getAccuratePacketCount
public long getAccuratePacketCount()
throws java.io.IOException
- Throws:
java.io.IOException
getAccuratePacketCount
public long getAccuratePacketCount(long limit)
throws java.io.IOException
- Throws:
java.io.IOException
getStatisticalPacketCount
public long getStatisticalPacketCount(double ganularity,
long samples)
throws java.io.IOException
- Throws:
java.io.IOException
getMaxPacketCount
public long getMaxPacketCount()
getCount
public long getCount()
throws java.io.IOException
- Description copied from class:
PacketCounter
- Gets the true and accurate count of the number of packets in the file.
This operation can be very expensive in terms of IO and time since some
capture files can be very very large.
- Specified by:
getCount in class PacketCounter
- Returns:
- Accurate packet count.
- Throws:
java.io.IOException
getCount
public long getCount(long limit)
throws java.io.IOException
- Description copied from class:
PacketCounter
- Gets the true and accurate count of the number of packets in the file.
This operation can be very expensive in terms of IO and time since some
capture files can be very very large.
- Specified by:
getCount in class PacketCounter
- Parameters:
limit - limit counting packets to maximimum set upto this limit.
- Returns:
- Accurate packet count.
- Throws:
java.io.IOException
getModel
public PacketCounterModel getModel()
- Description copied from class:
PacketCounter
- Returns the model that is being used by this packet counter. The model
may differ from the model that was initialy requested by the user or
from default. The packet counter switches models based on conditions and
resource parameters to fulfill the request.
- Specified by:
getModel in class PacketCounter
- Returns:
- Returns the model.