Class MTSValidPacketIterator
java.lang.Object
org.codice.ddf.libs.mpeg.transport.MTSValidPacketIterator
Support class for working with a stream of packets from a source where the underlying data may
cause exceptions. In this case, a greedy approach is taken; every bad packet is ignored without
limit in hopes good data will be encountered.
Caution: Be careful when modifying this class. Methods here mutate its state. While a recursive solution would have been preferrable, ingested products with sufficiently large segments of bad data would cause a stack overflow.
-
Constructor Summary
ConstructorsConstructorDescriptionMTSValidPacketIterator(org.taktik.mpegts.sources.ResettableMTSSource source) -
Method Summary
Modifier and TypeMethodDescriptionorg.taktik.mpegts.MTSPacketIterate through any number of exception-causing packets to reach either a valid one or the end of the packet stream.longlong
-
Constructor Details
-
MTSValidPacketIterator
public MTSValidPacketIterator(org.taktik.mpegts.sources.ResettableMTSSource source)
-
-
Method Details
-
getPacketsProcessed
public long getPacketsProcessed() -
getPacketsFailed
public long getPacketsFailed() -
getNextValidPacket
public org.taktik.mpegts.MTSPacket getNextValidPacket()Iterate through any number of exception-causing packets to reach either a valid one or the end of the packet stream.- Returns:
- The next packet in the provided source that does not throw an exception. Or
nullif no more packets are available.
-