Class RandomBytes


  • public final class RandomBytes
    extends java.lang.Object
    Random byte sequence generators.
    • Constructor Summary

      Constructors 
      Constructor Description
      RandomBytes()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] randomBytesOfLength​(java.util.Random r, int length)  
      static byte[] randomBytesOfLengthBetween​(java.util.Random r, int minLength, int maxLength)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RandomBytes

        public RandomBytes()
    • Method Detail

      • randomBytesOfLength

        public static byte[] randomBytesOfLength​(java.util.Random r,
                                                 int length)
        Parameters:
        r - Random generator.
        length - The length of the byte array. Can be zero.
        Returns:
        Returns a byte array with random content.
      • randomBytesOfLengthBetween

        public static byte[] randomBytesOfLengthBetween​(java.util.Random r,
                                                        int minLength,
                                                        int maxLength)
        Parameters:
        r - Random generator.
        minLength - The minimum length of the byte array. Can be zero.
        maxLength - The maximum length of the byte array. Can be zero.
        Returns:
        Returns a byte array with random content.