Package org.red5.server.net.rtmp.message
Class Packet
- java.lang.Object
-
- org.red5.server.net.rtmp.message.Packet
-
- All Implemented Interfaces:
Externalizable
,Serializable
public class Packet extends Object implements Externalizable
RTMP packet. Consists of packet header, data and event context.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearData()
Clears the data buffer.org.apache.mina.core.buffer.IoBuffer
getData()
Getter for datalong
getExpirationTime()
Return the expiration time.Header
getHeader()
Getter for headerIRTMPEvent
getMessage()
Getter for event contextboolean
hasData()
Returns whether or not the packet has a data buffer.boolean
isExpired()
Returns true if expiration time has been reached and false otherwise.boolean
isProcessed()
Gets the processed flag.void
readExternal(ObjectInput in)
void
setData(org.apache.mina.core.buffer.IoBuffer buffer)
Setter for datavoid
setExpirationTime(long expirationTime)
Set the expiration time.void
setMessage(IRTMPEvent message)
Setter for event contextvoid
setProcessed(boolean isProcessed)
Sets the processed flag.String
toString()
void
writeExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
Packet
public Packet()
-
Packet
public Packet(Header header)
Create packet with given header.- Parameters:
header
- Packet header
-
Packet
public Packet(Header header, IRTMPEvent event)
Create packet with given header and event context.- Parameters:
header
- RTMP headerevent
- RTMP message
-
-
Method Detail
-
getHeader
public Header getHeader()
Getter for header- Returns:
- Packet header
-
setMessage
public void setMessage(IRTMPEvent message)
Setter for event context- Parameters:
message
- RTMP event context
-
getMessage
public IRTMPEvent getMessage()
Getter for event context- Returns:
- RTMP event context
-
setData
public void setData(org.apache.mina.core.buffer.IoBuffer buffer)
Setter for data- Parameters:
buffer
- Packet data
-
getData
public org.apache.mina.core.buffer.IoBuffer getData()
Getter for data- Returns:
- Packet data
-
hasData
public boolean hasData()
Returns whether or not the packet has a data buffer.- Returns:
- true if data buffer exists and false otherwise
-
clearData
public void clearData()
Clears the data buffer.
-
getExpirationTime
public long getExpirationTime()
Return the expiration time.- Returns:
- expirationTime
-
setExpirationTime
public void setExpirationTime(long expirationTime)
Set the expiration time.- Parameters:
expirationTime
- new expiration time to set
-
isExpired
public boolean isExpired()
Returns true if expiration time has been reached and false otherwise.- Returns:
- expired or not
-
setProcessed
public void setProcessed(boolean isProcessed)
Sets the processed flag.- Parameters:
isProcessed
- true if processed and false otherwise
-
isProcessed
public boolean isProcessed()
Gets the processed flag.- Returns:
- true if processed and false otherwise
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
-