Class SUdpUtil


  • public class SUdpUtil
    extends java.lang.Object
    Utility functions and variables
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.security.SecureRandom RANDOM
      Random number source.
    • Constructor Summary

      Constructors 
      Constructor Description
      SUdpUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.security.SecureRandom getSecRandom()
      Gets the secure PRNG.
      static int intFromByteArray​(byte[] buffer, int offset)
      Reads an integer value from a byte array buffer in network byte order.
      static void intIntoByteArray​(byte[] buffer, int offset, int val)
      Writes an integer value into a byte array buffer in network byte order.
      static long longFromByteArray​(byte[] buffer, int offset)
      Reads a long value from a byte array buffer in network byte order.
      static void longIntoByteArray​(byte[] buffer, int offset, long val)
      Writes a long value into a byte array buffer in network byte order.
      static short shortFromByteArray​(byte[] buffer, int offset)
      Reads a short value from a byte array buffer in network byte order.
      static void shortIntoByteArray​(byte[] buffer, int offset, short val)
      Writes a short value into a byte array buffer in network byte order.
      • Methods inherited from class java.lang.Object

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

      • RANDOM

        public static volatile java.security.SecureRandom RANDOM
        Random number source.
    • Constructor Detail

      • SUdpUtil

        public SUdpUtil()
    • Method Detail

      • shortIntoByteArray

        public static final void shortIntoByteArray​(byte[] buffer,
                                                    int offset,
                                                    short val)
        Writes a short value into a byte array buffer in network byte order.
        Parameters:
        buffer - The buffer.
        offset - The offset.
        val - The value.
      • shortFromByteArray

        public static final short shortFromByteArray​(byte[] buffer,
                                                     int offset)
        Reads a short value from a byte array buffer in network byte order.
        Parameters:
        buffer - The buffer.
        offset - The offset.
        Returns:
        The value.
      • intIntoByteArray

        public static final void intIntoByteArray​(byte[] buffer,
                                                  int offset,
                                                  int val)
        Writes an integer value into a byte array buffer in network byte order.
        Parameters:
        buffer - The buffer.
        offset - The offset.
        val - The value.
      • intFromByteArray

        public static final int intFromByteArray​(byte[] buffer,
                                                 int offset)
        Reads an integer value from a byte array buffer in network byte order.
        Parameters:
        buffer - The buffer.
        offset - The offset.
        Returns:
        The value.
      • longIntoByteArray

        public static final void longIntoByteArray​(byte[] buffer,
                                                   int offset,
                                                   long val)
        Writes a long value into a byte array buffer in network byte order.
        Parameters:
        buffer - The buffer.
        offset - The offset.
        val - The value.
      • longFromByteArray

        public static final long longFromByteArray​(byte[] buffer,
                                                   int offset)
        Reads a long value from a byte array buffer in network byte order.
        Parameters:
        buffer - The buffer.
        offset - The offset.
        Returns:
        The value.
      • getSecRandom

        public static final java.security.SecureRandom getSecRandom()
        Gets the secure PRNG.
        Returns:
        Secure PRNG.