org.restcomm.media.stun.messages.attributes.address

Class AddressAttribute

    • Constructor Detail

      • AddressAttribute

        protected AddressAttribute(char attributeType)
    • Method Detail

      • setAttributeType

        protected void setAttributeType(char type)
        Description copied from class: StunAttribute
        Sets the attribute's type.
        Overrides:
        setAttributeType in class StunAttribute
        Parameters:
        type - the new type of this attribute
      • getPort

        public int getPort()
      • getAddressBytes

        public byte[] getAddressBytes()
        Returns the bytes of the address.
        Returns:
        the byte[] array containing the address.
      • getFamily

        public byte getFamily()
        Returns the family that the this.address belongs to.
        Returns:
        the family that the this.address belongs to.
      • getDataLength

        public char getDataLength()
        Description copied from class: StunAttribute
        Returns the length of this attribute's body.
        Specified by:
        getDataLength in class StunAttribute
        Returns:
        the length of this attribute's value.
      • encode

        public byte[] encode()
        Description copied from class: StunAttribute
        Returns a binary representation of this attribute.
        Specified by:
        encode in class StunAttribute
        Returns:
        a binary representation of this attribute.
      • decodeAttributeBody

        protected void decodeAttributeBody(byte[] attributeValue,
                               char offset,
                               char length)
                                    throws StunException
        Description copied from class: StunAttribute
        Sets this attribute's fields according to attributeValue array.
        Specified by:
        decodeAttributeBody in class StunAttribute
        Parameters:
        attributeValue - a binary array containing this attribute's field values and NOT containing the attribute header.
        offset - the position where attribute values begin (most often offset is equal to the index of the first byte after length)
        length - the length of the binary array.
        Throws:
        StunException - if attrubteValue contains invalid data.
      • equals

        public boolean equals(Object other)
        Compares two STUN Attributes. Attributes are considered equal when their type, length, and all data are the same.
        Specified by:
        equals in class StunAttribute
        Parameters:
        other - the object to compare this attribute with.
        Returns:
        true if the attributes are equal and false otherwise.

Copyright © 2017 TeleStax, Inc.. All Rights Reserved.