Here you can find the source of randomBytesWithEveryPossibleByteValueRepresentedAtLeastOnce()
public static byte[] randomBytesWithEveryPossibleByteValueRepresentedAtLeastOnce()
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { public static byte[] randomBytesWithEveryPossibleByteValueRepresentedAtLeastOnce() { Random r = new Random(); byte[] data = new byte[1024 * 1024 * 10]; r.nextBytes(data);/*from www .j a v a 2s .c om*/ byte next = Byte.MIN_VALUE; int numByteValuesPossible = (-Byte.MIN_VALUE) + Byte.MAX_VALUE; for (int x = 0; x < numByteValuesPossible; x++) { data[x] = next; next++; } return data; } }