Java Random Byte Array randomBytes(Random rand, int size)

Here you can find the source of randomBytes(Random rand, int size)

Description

random Bytes

License

Open Source License

Declaration

public static byte[] randomBytes(Random rand, int size) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Random;

public class Main {
    public static byte[] randomBytes(Random rand, int size) {
        byte[] bytes = new byte[size];
        rand.nextBytes(bytes);//from  w w w .ja  va 2s . c o m
        return bytes;
    }
}

Related

  1. randomBytes(int length)
  2. randomBytes(int minimumCharacters, int maximumCharacters)
  3. randomBytes(int size)
  4. randomBytes(long seed, int blockCount, int blockSize)
  5. randomBytes(Random r, int length)
  6. randomBytesSlowNextInt(Random r, byte[] buf, int from, int len)
  7. randomBytesWithEveryPossibleByteValueRepresentedAtLeastOnce()