public class RtcpPacketImpl extends AbstractPacket implements RtcpPacket
| Constructor and Description |
|---|
RtcpPacketImpl(TransportPacket parent,
Buffer headers,
Buffer payload) |
| Modifier and Type | Method and Description |
|---|---|
RtcpPacket |
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.
|
void |
write(OutputStream out,
Buffer payload)
Writes this packet to the
OutputStream with the supplied payload. |
checkParent, getName, getPacket, getParentPacket, getPayload, getProtocol, hasProtocol, verify, writeequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, getPacket, getParentPacket, getPayload, getProtocol, hasProtocol, verify, writepublic RtcpPacketImpl(TransportPacket parent, Buffer headers, Buffer payload)
public void write(OutputStream out, Buffer payload) throws IOException
OutputStream 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 PacketIOExceptionpublic Packet getNextPacket() throws IOException
getNextPacket in interface PacketIOExceptionpublic RtcpPacket clone()
clone in interface Packetclone in class AbstractPacketpublic long getArrivalTime()
SimpleDateFormat 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 PacketCopyright © 2021. All Rights Reserved.