Code example for Random

Methods: nextBytesnextInt

0
	 * @param rand 
	 * @param maxSize 
	 * @return 
	 */ 
	public static byte[] createRandomBlob(Random rand, int maxSize){
		int size = rand.nextInt(maxSize);
		// Exclude zero 
		size++;
		byte[] array = new byte[size];
		rand.nextBytes(array);
		return array;
	} 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE