Class PendingPacket

java.lang.Object
com.tenio.core.network.zero.codec.packet.PendingPacket

public final class PendingPacket extends Object
Holds a pending packet for the next steps.
  • Method Details

    • newInstance

      public static PendingPacket newInstance()
      Create a new instance.
      Returns:
      a new instance of PendingPacket
    • getPacketHeader

      public PacketHeader getPacketHeader()
      Retrieves a packet's header.
      Returns:
      the PacketHeader of the packet
    • setPacketHeader

      public void setPacketHeader(PacketHeader packetHeader)
      Sets a packetHeader for a packet.
      Parameters:
      packetHeader - a PacketHeader of the packet
    • getBuffer

      public ByteBuffer getBuffer()
      Retrieves a ByteBuffer instance to read/write packet's data.
      Returns:
      a ByteBuffer instance to read/write packet's data
    • setBuffer

      public void setBuffer(ByteBuffer byteBuffer)
      Sets a ByteBuffer instance to read/write packet's data.
      Parameters:
      byteBuffer - a ByteBuffer 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

      public String toString()
      Overrides:
      toString in class Object