Class PendingPacket
java.lang.Object
com.tenio.core.network.zero.codec.packet.PendingPacket
Holds a pending packet for the next steps.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves aByteBuffer
instance to read/write packet's data.int
Retrieves the expected length of packet's data.Retrieves a packet's header.static PendingPacket
Create a new instance.void
setBuffer
(ByteBuffer byteBuffer) Sets aByteBuffer
instance to read/write packet's data.void
setExpectedLength
(int expectedLength) Sets the expected length for the packet's data.void
setPacketHeader
(PacketHeader packetHeader) Sets a packetHeader for a packet.toString()
-
Method Details
-
newInstance
Create a new instance.- Returns:
- a new instance of
PendingPacket
-
getPacketHeader
Retrieves a packet's header.- Returns:
- the
PacketHeader
of the packet
-
setPacketHeader
Sets a packetHeader for a packet.- Parameters:
packetHeader
- aPacketHeader
of the packet
-
getBuffer
Retrieves aByteBuffer
instance to read/write packet's data.- Returns:
- a
ByteBuffer
instance to read/write packet's data
-
setBuffer
Sets aByteBuffer
instance to read/write packet's data.- Parameters:
byteBuffer
- aByteBuffer
instance to read/write packet's data
-
getExpectedLength
public int getExpectedLength()Retrieves the expected length of packet's data.- Returns:
- the expected length of packet's data (
integer
value)
-
setExpectedLength
public void setExpectedLength(int expectedLength) Sets the expected length for the packet's data.- Parameters:
expectedLength
- the expected length of packet's data (integer
value)
-
toString
-