Class PacketImpl
java.lang.Object
com.tenio.core.network.entity.packet.implement.PacketImpl
- All Implemented Interfaces:
Packet
,Cloneable
,Comparable<Packet>
The implementation for packet.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclone()
int
boolean
long
byte[]
getData()
byte[]
long
getId()
int
int
hashCode()
It is generally necessary to override the hashCode method whenever equals method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.boolean
boolean
boolean
isTcp()
boolean
isUdp()
boolean
static Packet
void
setData
(byte[] binary) void
setEncrypted
(boolean encrypted) void
setFragmentBuffer
(byte[] binary) void
setPriority
(ResponsePriority priority) void
setRecipients
(Collection<Session> recipients) void
toString()
-
Method Details
-
newInstance
-
getId
public long getId() -
getData
public byte[] getData() -
setData
public void setData(byte[] binary) -
getTransportType
- Specified by:
getTransportType
in interfacePacket
-
setTransportType
- Specified by:
setTransportType
in interfacePacket
-
getPriority
- Specified by:
getPriority
in interfacePacket
-
setPriority
- Specified by:
setPriority
in interfacePacket
-
isEncrypted
public boolean isEncrypted()- Specified by:
isEncrypted
in interfacePacket
-
setEncrypted
public void setEncrypted(boolean encrypted) - Specified by:
setEncrypted
in interfacePacket
-
getRecipients
- Specified by:
getRecipients
in interfacePacket
-
setRecipients
- Specified by:
setRecipients
in interfacePacket
-
getCreatedTime
public long getCreatedTime()- Specified by:
getCreatedTime
in interfacePacket
-
getOriginalSize
public int getOriginalSize()- Specified by:
getOriginalSize
in interfacePacket
-
isTcp
public boolean isTcp() -
isUdp
public boolean isUdp() -
isWebSocket
public boolean isWebSocket()- Specified by:
isWebSocket
in interfacePacket
-
getFragmentBuffer
public byte[] getFragmentBuffer()- Specified by:
getFragmentBuffer
in interfacePacket
-
setFragmentBuffer
public void setFragmentBuffer(byte[] binary) - Specified by:
setFragmentBuffer
in interfacePacket
-
isFragmented
public boolean isFragmented()- Specified by:
isFragmented
in interfacePacket
-
equals
-
hashCode
public int hashCode()It is generally necessary to override the hashCode method whenever equals method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes. -
compareTo
- Specified by:
compareTo
in interfaceComparable<Packet>
-
toString
-
clone
-