Class ByteArraySection

    • Constructor Detail

      • ByteArraySection

        public ByteArraySection()
        Constructs an empty ByteArraySection.
      • ByteArraySection

        public ByteArraySection​(byte[] aPayload)
        Constructs a ByteArraySection with the given byte array payload.
        Parameters:
        aPayload - The payload to be contained by the Section.
      • ByteArraySection

        public ByteArraySection​(Byte[] aPayload)
        Constructs a ByteArraySection with the given byte array payload.
        Parameters:
        aPayload - The payload to be contained by the Section.
      • ByteArraySection

        public ByteArraySection​(String aAlias)
        Constructs an empty ByteArraySection.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
      • ByteArraySection

        public ByteArraySection​(String aAlias,
                                byte[] aPayload)
        Constructs a ByteArraySection with the given byte array payload.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
        aPayload - The payload to be contained by the Section.
      • ByteArraySection

        public ByteArraySection​(String aAlias,
                                Byte[] aPayload)
        Constructs a ByteArraySection with the given byte array payload.
        Parameters:
        aAlias - The alias which identifies the content of this segment.
        aPayload - The payload to be contained by the Section.
    • Method Detail

      • getLength

        public int getLength()
        Determines the overall length of this Transmission. In case of nested Transmission instances, all length values from all sub-segments are accumulated to the result as well.
        Specified by:
        getLength in interface org.refcodes.mixin.LengthAccessor
        Specified by:
        getLength in interface Transmission
        Returns:
        The (overall) length of the Transmission (including any sub-segments).
      • withPayload

        public ByteArraySection withPayload​(byte[] aValue)
        Specified by:
        withPayload in interface org.refcodes.mixin.PayloadAccessor.PayloadBuilder<byte[],​PayloadTransmission<byte[]>>
      • setPayload

        public void setPayload​(Byte[] aPayload)
        Convenience method to convert the array of wrapper types into its counterpart with primitive types before invoking AbstractPayloadSection.setPayload(Object).
        Parameters:
        aPayload - The payload with the wrapper types.
      • withPayload

        public ByteArraySection withPayload​(Byte[] aPayload)
        Convenience method to convert the array of wrapper types into its counterpart with primitive types before invoking withPayload(byte[]).
        Parameters:
        aPayload - The payload with the wrapper types.
        Returns:
        This instance as of the builder pattern.