public final class SDPPacketImpl extends AbstractPacket implements SDPPacket
| Constructor and Description |
|---|
SDPPacketImpl(Packet parent,
SDP actualSDP) |
| Modifier and Type | Method and Description |
|---|---|
SDPPacket |
clone() |
long |
getArrivalTime()
The arrival time of this packet in microseconds relative to epoch
(midnight UTC of January 1, 1970).
|
Packet |
getNextPacket()
Get the next frame, or null if there is none.
|
Buffer |
getPayload()
Get the payload of the frame.
|
Buffer |
toBuffer() |
String |
toString() |
void |
verify()
Calling this method will force the packet to completely parse its data
and check so that all the information conforms to whatever rules this
packet needs to follow.
|
void |
write(OutputStream out,
Buffer payload)
Writes this packet to the
OutputStream with the supplied payload. |
checkParent, getName, getPacket, getParentPacket, getProtocol, hasProtocol, writeequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, getPacket, getParentPacket, getProtocol, hasProtocol, writepublic long getArrivalTime()
PacketSimpleDateFormat but it can
only handle milliseconds precision (you will have to write your own date
formatter if you want microseconds).
Here is a snippet illustrating how to turn the arrival time of the packet
into a human readable date
Packet p = ...;
SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss.SSS");
Date date = new Date(p.getArrivalTime() / 1000);
System.out.println("Arrival time: " + formatter.format(date));
Note how an integer devision is performed on the arrival time to
"cut off" the microseconds from the time stampgetArrivalTime in interface Packetpublic void verify()
PacketIPPacket, hardly does anything
in this method but more complex protocols such as SIP (once again), HTTP
etc can spend quite some time verifying everything, which is why you
don't want to do it unless you really have to.
In general, yajpcap has the philosophy of
"assume that everything is ok until things blow up and then deal with it"verify in interface Packetverify in class AbstractPacketpublic Buffer getPayload()
PacketgetPayload in interface PacketgetPayload in class AbstractPacketpublic SDPPacket clone()
clone in interface Packetclone in class AbstractPacketpublic Packet getNextPacket() throws IOException
PacketgetNextPacket in interface PacketIOExceptionpublic void write(OutputStream out, Buffer payload) throws IOException
PacketOutputStream with the supplied payload.
You can use this method to e.g. write a raw UDPPacket to the
stream with this payload. Note, if the UDPPacket already had a
payload it will be ignored so use this method with care.write in interface PacketIOExceptionCopyright © 2021. All Rights Reserved.