Java Random Byte Array getRandomBytes()

Here you can find the source of getRandomBytes()

Description

get Random Bytes

License

Apache License

Declaration

public static byte[] getRandomBytes() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Random;

public class Main {
    static Random random = new Random();

    public static byte[] getRandomBytes() {
        byte[] bytes = new byte[1024];
        random.nextBytes(bytes);/*from w  w w.  j a  v  a  2  s  .  c o  m*/
        return bytes;
    }
}

Related

  1. generateRandomBytes(int num)
  2. generateRandomBytes(int num_to_generate)
  3. generateRandomBytes(int num_to_generate)
  4. generateRandomBytes(int size)
  5. getRandomByteArray(int len)
  6. getRandomBytes(int size)
  7. getRandomBytes(int size)
  8. nextBytes(byte[] bytes)
  9. nextBytes(int count)