Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8188048

Add SplittableRandom.nextBytes

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 10
    • core-libs
    • None
    • minimal
    • None. This is a new method on a final class.
    • Java API
    • SE

      Summary

      Add SplittableRandom.nextBytes(byte[]).

      Problem

      java.util.Random has a nextBytes method, and SplittableRandom implements most Random methods, but nextBytes was missed.

      Solution

      Implement nextBytes in the obvious way.

      Specification

          /**
           * Fills a user-supplied byte array with generated pseudorandom bytes.
           *
           * @param  bytes the byte array to fill with pseudorandom bytes
           * @throws NullPointerException if bytes is null
           * @since  10
           */
          public void nextBytes(byte[] bytes) {

            martin Martin Buchholz
            martin Martin Buchholz
            Doug Lea, Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: