Here you can find the source of randomBlock(byte[] block, int off, int len)
public static void randomBlock(byte[] block, int off, int len)
//package com.java2s; public class Main { public static void randomBlock(byte[] block, int off, int len) { for (int i = off; i < off + len; ++i) block[i] = (byte) (Math.random() * 256.0); }//from w ww . j av a2s .co m public static void randomBlock(byte[] block) { randomBlock(block, 0, block.length); } }