public class RandomUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
generateRandomBytes()
Generates a byte array containing random data.
|
static byte[] |
generateRandomBytes(int numBytes)
Generates a byte array containing random data.
|
static int |
generateRandomInt()
Returns a pseudorandom, uniformly distributed
int value between 0 (inclusive) and the
specified value (exclusive)/ |
static int |
generateRandomInt(int bound)
Returns a pseudorandom, uniformly distributed
int value between 0 (inclusive) and the
specified value (exclusive)/ |
public static byte[] generateRandomBytes(int numBytes)
numBytes
- The number of bytes to generate.public static byte[] generateRandomBytes()
public static int generateRandomInt(int bound)
int
value between 0 (inclusive) and the
specified value (exclusive)/bound
- the upper bound (exclusive). Must be positive.public static int generateRandomInt()
int
value between 0 (inclusive) and the
specified value (exclusive)/