Java Random Byte Array generateRandomBytes(final int pSize)

Here you can find the source of generateRandomBytes(final int pSize)

Description

Generating random bytes.

License

Open Source License

Return

the random bytes

Declaration

public static final byte[] generateRandomBytes(final int pSize) 

Method Source Code

//package com.java2s;

import java.util.Random;

public class Main {
    /** Common random instance for generating common tag names. */
    public final static Random random = new Random(123l);

    /**/* w  ww .j a  v  a 2  s  .c o m*/
     * Generating random bytes.
     * 
     * @return the random bytes
     */
    public static final byte[] generateRandomBytes(final int pSize) {
        final byte[] returnVal = new byte[pSize];
        random.nextBytes(returnVal);
        return returnVal;
    }
}

Related

  1. generateRandomByteArray(int length)
  2. generateRandomByteArray(int length, boolean avoid, byte avoidByte)
  3. generateRandomByteArray(int size)
  4. generateRandomByteArray(int size, Random rnd)
  5. generateRandomBytes()
  6. generateRandomBytes(int n)
  7. generateRandomBytes(int num)
  8. generateRandomBytes(int num_to_generate)
  9. generateRandomBytes(int num_to_generate)