public final class ByteUtil extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
randomBytes()
Random array of bytes with a random length.
|
static byte[] |
randomBytes(int length)
Get a random array of bytes with the length specified.
|
static byte[] |
randomBytes(Random r)
Random array of bytes with a random length.
|
static byte[] |
randomBytes(Random r,
int length)
For those that like the random bytes to be created and returned.
|
public static byte[] randomBytes(Random r, int length)
Random.nextBytes(byte[])
method to generate the random data.r
- to keep the same randomizer just pass it in..length
- size of the array of random data returned.public static byte[] randomBytes(int length)
length
- the size of the byte array returned.public static byte[] randomBytes(Random r)
r
- uses the randomizer provided to generate the random data.public static byte[] randomBytes()
Copyright © 2019. All rights reserved.