public interface Stream<T extends Packet>
Stream represents a set of Packets that belong together.
E.g., in SIP, messages that goes within the same dialog will be grouped into
a single stream.| Modifier and Type | Method and Description |
|---|---|
long |
getDuration()
Get the duration in microseconds of the stream.
|
List<T> |
getPackets()
Get all
Packets that belongs to this stream. |
StreamId |
getStreamIdentifier()
|
long |
getTimeOfFirstPacket()
Get the arrival time of the very first packet in this stream.
|
long |
getTimeOfLastPacket()
Get the arrival time of the last packet in this stream.
|
void |
write(OutputStream out)
Write this
Stream to the specified OutputStream. |
long getDuration()
Packet.getArrivalTime() regarding the microsecond precision.
Depending on the underlying protocol this can be as simple as the time
between the first to the last packet, which is what the RtpStream
does. Or, it can be more complicated as with a SipStream that
checks the duration of the dialog (if one was established).Stream. If the
duration cannot be calulated for whatever reason (no packets at
all? Only one packet?), then -1 (negative one) will be returned.long getTimeOfFirstPacket()
Packet.getArrivalTime() regarding the
microsecond precision.Stream doesn't contain any
packets.long getTimeOfLastPacket()
Packet.getArrivalTime() regarding the
microsecond precision.Stream doesn't contain any
packets.StreamId getStreamIdentifier()
void write(OutputStream out) throws IOException
out - the OutputStream, which typically is a
PcapOutputStream.IOExceptionCopyright © 2021. All Rights Reserved.