Package 

Class RawMessage

  • All Implemented Interfaces:

    
    public class RawMessage
    
                        

    The class represents a binary STUN message as well as the address and port of the host that sent it and the address and port where it was received (locally).

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      int getMessageLength() Returns the message length.
      TransportAddress getRemoteAddress() Returns the address and port of the host that sent the message
      TransportAddress getLocalAddress() Returns the address that this message was received on.
      Array<byte> getBytes() Returns the message itself.
      static RawMessage build(Array<byte> messageBytes, int messageLength, TransportAddress remoteAddress, TransportAddress localAddress) Use builder pattern to allow creation of immutable RawMessage instances, from outside the current package.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • build

         static RawMessage build(Array<byte> messageBytes, int messageLength, TransportAddress remoteAddress, TransportAddress localAddress)

        Use builder pattern to allow creation of immutable RawMessage instances, from outside the current package.

        Parameters:
        messageBytes - the message itself.
        messageLength - the number of bytes currently stored in the messageBytes array.
        remoteAddress - the address where the message came from.
        localAddress - the TransportAddress that the message was received on.