Here you can find the source of getRandomBytes()
public static byte[] getRandomBytes()
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { static Random random = new Random(); public static byte[] getRandomBytes() { byte[] bytes = new byte[1024]; random.nextBytes(bytes);/*from w w w. j a v a 2 s . c o m*/ return bytes; } }