Class CodecUtility

java.lang.Object
com.tenio.core.network.zero.codec.CodecUtility

public final class CodecUtility extends Object
The utility class provides methods to work with packet and binary.
  • Method Details

    • decodeFirstHeaderByte

      public static PacketHeader decodeFirstHeaderByte(byte headerByte)
      Decoding the header byte to find the packet header setting.
      Parameters:
      headerByte - the first read byte
      Returns:
      the setup packet header
    • encodeFirstHeaderByte

      public static byte encodeFirstHeaderByte(PacketHeader packetHeader)
      Encoding the packet header setting to a byte value.
      Parameters:
      packetHeader - the packet header instance
      Returns:
      the encoded packet header in byte value