Package org.identityconnectors.common
Class ByteUtil
java.lang.Object
org.identityconnectors.common.ByteUtil
Utility package for byte manipulation.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
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[]
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.
-
Method Details
-
randomBytes
For those that like the random bytes to be created and returned. Uses theRandom.nextBytes(byte[])
method to generate the random data.- Parameters:
r
- to keep the same randomizer just pass it in..length
- size of the array of random data returned.- Returns:
- byte array of random data.
-
randomBytes
public static byte[] randomBytes(int length) Get a random array of bytes with the length specified.- Parameters:
length
- the size of the byte array returned.- Returns:
- random array of bytes with the length specified.
-
randomBytes
Random array of bytes with a random length. The length should be no greater that 4k.- Parameters:
r
- uses the randomizer provided to generate the random data.- Returns:
- a byte array no bigger than 4k filled with random data.
-
randomBytes
public static byte[] randomBytes()Random array of bytes with a random length. The length should be no greater that 4k.- Returns:
- a byte array no bigger than 4k filled with random data.
-