Package 

Class ChannelData

  • All Implemented Interfaces:

    
    public class ChannelData
    
                        

    The ChannelData message are used in TURN protocol after a client has bound a channel to a peer. 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Channel Number | Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | / Application Data / / / | | | +-------------------------------+ | | +-------------------------------+

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      ChannelData() Constructor.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      char getChannelNumber() Get the channel number.
      void setChannelNumber(char channelNumber) Set the channel number
      Array<byte> getData() Get the data.
      void setData(Array<byte> data) Set the data.
      char getDataLength() Get the data length (without padding).
      Array<byte> encode() Returns a non padded binary representation of this message.
      Array<byte> encode(boolean pad) Returns a binary representation of this message.
      static ChannelData decode(Array<byte> binMessage, char offset, char arrayLen) Constructs a message from its binary representation.
      static ChannelData decode(Array<byte> binMessage, char offset) Constructs a message from its binary representation.
      static boolean isChannelDataMessage(Array<byte> binMessage) Checks if the given binary message is a ChannelData Message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChannelData

        ChannelData()
        Constructor.
    • Method Detail

      • setChannelNumber

         void setChannelNumber(char channelNumber)

        Set the channel number

        Parameters:
        channelNumber - the channel number
      • setData

         void setData(Array<byte> data)

        Set the data.

        Parameters:
        data - the data
      • getDataLength

         char getDataLength()

        Get the data length (without padding).

      • encode

         Array<byte> encode()

        Returns a non padded binary representation of this message.

      • encode

         Array<byte> encode(boolean pad)

        Returns a binary representation of this message.

        Parameters:
        pad - determine if we pad this message
      • decode

         static ChannelData decode(Array<byte> binMessage, char offset, char arrayLen)

        Constructs a message from its binary representation.

        Parameters:
        binMessage - the binary array that contains the encoded message
        offset - the index where the message starts.
        arrayLen - the length of the message
      • decode

         static ChannelData decode(Array<byte> binMessage, char offset)

        Constructs a message from its binary representation.

        Parameters:
        binMessage - the binary array that contains the encoded message
        offset - the index where the message starts.
      • isChannelDataMessage

         static boolean isChannelDataMessage(Array<byte> binMessage)

        Checks if the given binary message is a ChannelData Message. Every ChannelData message has first two bits as 01.

        Parameters:
        binMessage - binary message to check.