Package org.activecomponents.udp
Class SUdpUtil
- java.lang.Object
-
- org.activecomponents.udp.SUdpUtil
-
public class SUdpUtil extends java.lang.ObjectUtility functions and variables
-
-
Field Summary
Fields Modifier and Type Field Description static java.security.SecureRandomRANDOMRandom number source.
-
Constructor Summary
Constructors Constructor Description SUdpUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.security.SecureRandomgetSecRandom()Gets the secure PRNG.static intintFromByteArray(byte[] buffer, int offset)Reads an integer value from a byte array buffer in network byte order.static voidintIntoByteArray(byte[] buffer, int offset, int val)Writes an integer value into a byte array buffer in network byte order.static longlongFromByteArray(byte[] buffer, int offset)Reads a long value from a byte array buffer in network byte order.static voidlongIntoByteArray(byte[] buffer, int offset, long val)Writes a long value into a byte array buffer in network byte order.static shortshortFromByteArray(byte[] buffer, int offset)Reads a short value from a byte array buffer in network byte order.static voidshortIntoByteArray(byte[] buffer, int offset, short val)Writes a short value into a byte array buffer in network byte order.
-
-
-
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.
-
-