Here you can find the source of randomBytesSlowNextInt(Random r, byte[] buf, int from, int len)
static private void randomBytesSlowNextInt(Random r, byte[] buf, int from, int len)
//package com.java2s; /* This code is part of Freenet. It is distributed under the GNU General * Public License, version 2 (or at your option any later version). See * http://www.gnu.org/ for further details of the GPL. */ import java.util.Random; public class Main { /** Fill specified range of byte array with random data. */ static private void randomBytesSlowNextInt(Random r, byte[] buf, int from, int len) { if (from == 0 && len == buf.length) { r.nextBytes(buf);/* www . j a va 2 s . co m*/ return; } byte[] tmp = new byte[len]; r.nextBytes(tmp); System.arraycopy(tmp, 0, buf, from, len); } }