Class Fragment

    • Field Detail

      • nextHeader

        protected byte nextHeader
      • fragmentOffset

        protected short fragmentOffset
      • moreFragment

        protected byte moreFragment
      • identification

        protected int identification
    • Constructor Detail

      • Fragment

        public Fragment()
    • Method Detail

      • setNextHeader

        public Fragment setNextHeader​(byte nextHeader)
        Description copied from interface: IExtensionHeader
        Sets the type of next header.
        Specified by:
        setNextHeader in interface IExtensionHeader
        Parameters:
        nextHeader - the next header to set
        Returns:
        this
      • getFragmentOffset

        public short getFragmentOffset()
        Gets the fragment offset of this header.
        Returns:
        fragment offset
      • setFragmentOffset

        public Fragment setFragmentOffset​(short fragmentOffset)
        Sets the fragment offset of this header.
        Parameters:
        fragmentOffset - the fragment offset to set
        Returns:
        this
      • getMoreFragment

        public byte getMoreFragment()
        Gets the more fragment flag of this header.
        Returns:
        more fragment flag
      • setMoreFragment

        public Fragment setMoreFragment​(byte moreFragment)
        Sets the more fragment flag of this header.
        Parameters:
        moreFragment - the more fragment flag to set
        Returns:
        this
      • getIdentification

        public int getIdentification()
        Gets the identification of this header.
        Returns:
        identification
      • setIdentification

        public Fragment setIdentification​(int identification)
        Sets the identification of this header.
        Parameters:
        identification - the identification to set
        Returns:
        this
      • serialize

        public byte[] serialize()
        Description copied from interface: IPacket
        Sets all payloads parent packet if applicable, then serializes this packet and all payloads.
        Specified by:
        serialize in interface IPacket
        Returns:
        a byte[] containing this packet and payloads
      • deserializer

        public static Deserializer<Fragment> deserializer()
        Deserializer function for fragment headers.
        Returns:
        deserializer function