Here you can find the source of randomData(Random random, int length)
public static byte[] randomData(Random random, int length)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static byte[] randomData(Random random, int length) { byte[] data = new byte[length]; random.nextBytes(data);/* www.ja v a 2 s .co m*/ return data; } }