# SplittableRandom

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# SplittableRandom

```
class SplittableRandom : RandomGenerator, RandomGenerator.SplittableGenerator
```

|---|----------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                           ||
| ↳ | [java.util.SplittableRandom](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#) |

A generator of uniform pseudorandom values (with period 264) applicable for use in (among other contexts) isolated parallel computations that may generate subtasks. Class`SplittableRandom`supports methods for producing pseudorandom numbers of type`int`,`long`, and`double`with similar usages as for class[java.util.Random](https://developer.android.com/reference/kotlin/java/util/Random)but differs in the following ways:

- Series of generated values pass the DieHarder suite testing independence and uniformity properties of random number generators. (Most recently validated with[version 3.31.1](http://www.phy.duke.edu/~rgb/General/dieharder.php).) These tests validate only the methods for certain types and ranges, but similar properties are expected to hold, at least approximately, for others as well. The*period*(length of any series of generated values before it repeats) is 264.
- Method #split constructs and returns a new SplittableRandom instance that shares no mutable state with the current instance. However, with very high probability, the values collectively generated by the two objects have the same statistical properties as if the same quantity of values were generated by a single thread using a single`SplittableRandom`object.
- Instances of SplittableRandom are*not* thread-safe. They are designed to be split, not shared, across threads. For example, a[fork/join-style](https://developer.android.com/reference/kotlin/java/util/concurrent/ForkJoinTask)computation using random numbers might include a construction of the form`new Subtask(aSplittableRandom.split()).fork()`.
- This class provides additional methods for generating random streams, that employ the above techniques when used in`stream.parallel()`mode.

<br />

Instances of`SplittableRandom`are not cryptographically secure. Consider instead using[java.security.SecureRandom](https://developer.android.com/reference/kotlin/java/security/SecureRandom.html#)in security-sensitive applications. Additionally, default-constructed instances do not use a cryptographically random seed unless the java.lang.System#getProperty`java.util.secureRandomSeed`is set to`true`.

## Summary

|                                                                                                                                                                           Public constructors                                                                                                                                                                           ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [SplittableRandom](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#SplittableRandom())`()` Creates a new SplittableRandom instance that is likely to generate sequences of values that are statistically independent of those of any other instances in the current program; and may, and typically does, vary across program invocations. |
| [SplittableRandom](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#SplittableRandom(kotlin.Long))`(`seed:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Creates a new SplittableRandom instance using the specified initial seed.                                                                      |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                      Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                       ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DoubleStream](https://developer.android.com/reference/kotlin/java/util/stream/DoubleStream)!                                                                                                                                    | [doubles](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#doubles())`()` Returns an effectively unlimited stream of pseudorandom`double`values from this generator and/or one split from it; each value is between zero (inclusive) and one (exclusive).                                                                                                                                                                                                                                                                                                                                                                                                      |
| [DoubleStream](https://developer.android.com/reference/kotlin/java/util/stream/DoubleStream)!                                                                                                                                    | [doubles](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#doubles(kotlin.Double,%20kotlin.Double))`(`randomNumberOrigin:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, `randomNumberBound:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`)` Returns an effectively unlimited stream of pseudorandom`double`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).                                                                                                                                        |
| [DoubleStream](https://developer.android.com/reference/kotlin/java/util/stream/DoubleStream)!                                                                                                                                    | [doubles](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#doubles(kotlin.Long))`(`streamSize:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Returns a stream producing the given`streamSize`number of pseudorandom`double`values from this generator and/or one split from it; each value is between zero (inclusive) and one (exclusive).                                                                                                                                                                                                                                                                                |
| [DoubleStream](https://developer.android.com/reference/kotlin/java/util/stream/DoubleStream)!                                                                                                                                    | [doubles](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#doubles(kotlin.Long,%20kotlin.Double,%20kotlin.Double))`(`streamSize:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `randomNumberOrigin:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, `randomNumberBound:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`)` Returns a stream producing the given`streamSize`number of pseudorandom`double`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).            |
| [IntStream](https://developer.android.com/reference/kotlin/java/util/stream/IntStream)!                                                                                                                                          | [ints](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#ints())`()` Returns an effectively unlimited stream of pseudorandom`int`values from this generator and/or one split from it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [IntStream](https://developer.android.com/reference/kotlin/java/util/stream/IntStream)!                                                                                                                                          | [ints](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#ints(kotlin.Int,%20kotlin.Int))`(`randomNumberOrigin:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `randomNumberBound:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Returns an effectively unlimited stream of pseudorandom`int`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).                                                                                                                                                                   |
| [IntStream](https://developer.android.com/reference/kotlin/java/util/stream/IntStream)!                                                                                                                                          | [ints](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#ints(kotlin.Long))`(`streamSize:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Returns a stream producing the given`streamSize`number of pseudorandom`int`values from this generator and/or one split from it.                                                                                                                                                                                                                                                                                                                                                     |
| [IntStream](https://developer.android.com/reference/kotlin/java/util/stream/IntStream)!                                                                                                                                          | [ints](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#ints(kotlin.Long,%20kotlin.Int,%20kotlin.Int))`(`streamSize:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `randomNumberOrigin:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `randomNumberBound:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Returns a stream producing the given`streamSize`number of pseudorandom`int`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).                                       |
| [LongStream](https://developer.android.com/reference/kotlin/java/util/stream/LongStream)!                                                                                                                                        | [longs](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#longs())`()` Returns an effectively unlimited stream of pseudorandom`long`values from this generator and/or one split from it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [LongStream](https://developer.android.com/reference/kotlin/java/util/stream/LongStream)!                                                                                                                                        | [longs](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#longs(kotlin.Long))`(`streamSize:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Returns a stream producing the given`streamSize`number of pseudorandom`long`values from this generator and/or one split from it.                                                                                                                                                                                                                                                                                                                                                  |
| [LongStream](https://developer.android.com/reference/kotlin/java/util/stream/LongStream)!                                                                                                                                        | [longs](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#longs(kotlin.Long,%20kotlin.Long))`(`randomNumberOrigin:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `randomNumberBound:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Returns an effectively unlimited stream of pseudorandom`long`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).                                                                                                                                                          |
| [LongStream](https://developer.android.com/reference/kotlin/java/util/stream/LongStream)!                                                                                                                                        | [longs](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#longs(kotlin.Long,%20kotlin.Long,%20kotlin.Long))`(`streamSize:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `randomNumberOrigin:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `randomNumberBound:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Returns a stream producing the given`streamSize`number of pseudorandom`long`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).                              |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                                                     | [nextBytes](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#nextBytes(kotlin.ByteArray))`(`bytes:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!`)` Fills a user-supplied byte array with generated byte values pseudorandomly chosen uniformly from the range of values between -128 (inclusive) and 127 (inclusive).                                                                                                                                                                                                                                                                                            |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                                       | [nextInt](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#nextInt())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)                                                                                                                                                     | [nextLong](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#nextLong())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [SplittableRandom](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#)!                                                                                                                                  | [split](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#split())`()` Constructs and returns a new SplittableRandom instance that shares no mutable state with this instance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [SplittableRandom](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#)!                                                                                                                                  | [split](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#split(java.util.random.RandomGenerator.SplittableGenerator))`(`source:` `[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!`)` Returns a new pseudorandom number generator, split off from this one, that implements the[RandomGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator)and[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interfaces.                                           |
| [Stream](https://developer.android.com/reference/kotlin/java/util/stream/Stream)\<[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!\>! | [splits](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#splits())`()` Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements the[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interface.                                                                                                                                                                                                                                                                                                                                        |
| [Stream](https://developer.android.com/reference/kotlin/java/util/stream/Stream)\<[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!\>! | [splits](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#splits(java.util.random.RandomGenerator.SplittableGenerator))`(`source:` `[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!`)` Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements the[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interface.                                                                                                                             |
| [Stream](https://developer.android.com/reference/kotlin/java/util/stream/Stream)\<[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!\>! | [splits](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#splits(kotlin.Long))`(`streamSize:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Returns a stream producing the given`streamSize`number of new pseudorandom number generators, each of which implements the[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interface.                                                                                                                                                                                                                  |
| [Stream](https://developer.android.com/reference/kotlin/java/util/stream/Stream)\<[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!\>! | [splits](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#splits(kotlin.Long,%20java.util.random.RandomGenerator.SplittableGenerator))`(`streamSize:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `source:` `[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!`)` Returns a stream producing the given`streamSize`number of new pseudorandom number generators, each of which implements the[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interface. |

| Inherited functions ||
|---|---|
| From class[RandomGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator) |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isDeprecated](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#isDeprecated())`()` <br /> Return true if the implementation of RandomGenerator (algorithm) has been marked for deprecation. <br />                                                                                                                                                                                                                                                                                                              | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [nextBoolean](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextBoolean())`()` <br /> Returns a pseudorandomly chosen`boolean`value. The default implementation tests the high-order bit (sign bit) of a value produced by[nextInt](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextInt())(), on the grounds that some algorithms for pseudorandom number generation produce values whose high-order bits have better statistical quality than the low-order bits. <br /> | | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)   | [nextDouble](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextDouble())`()` <br /> Returns a pseudorandom`double`value between zero (inclusive) and one (exclusive). <br />                                                                                                                                                                                                                                                                                                                                  | | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)   | [nextDouble](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextDouble(kotlin.Double))`(`bound:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`)` <br /> Returns a pseudorandomly chosen`double`value between zero (inclusive) and the specified bound (exclusive). <br />                                                                                                                                                                                                 | | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)   | [nextDouble](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextDouble(kotlin.Double,%20kotlin.Double))`(`origin:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, `bound:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`)` <br /> Returns a pseudorandomly chosen`double`value between the specified origin (inclusive) and the specified bound (exclusive). <br />                                                                  | | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)   | [nextExponential](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextExponential())`()` <br /> Returns a nonnegative`double`value pseudorandomly chosen from an exponential distribution whose mean is 1. <br />                                                                                                                                                                                                                                                                                               | | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)     | [nextFloat](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextFloat())`()` <br /> Returns a pseudorandom`float`value between zero (inclusive) and one (exclusive). <br />                                                                                                                                                                                                                                                                                                                                     | | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)     | [nextFloat](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextFloat(kotlin.Float))`(`bound:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` <br /> Returns a pseudorandomly chosen`float`value between zero (inclusive) and the specified bound (exclusive). <br />                                                                                                                                                                                                       | | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)     | [nextFloat](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextFloat(kotlin.Float,%20kotlin.Float))`(`origin:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `bound:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` <br /> Returns a pseudorandomly chosen`float`value between the specified origin (inclusive) and the specified bound (exclusive). <br />                                                                           | | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)   | [nextGaussian](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextGaussian())`()` <br /> Returns a`double`value pseudorandomly chosen from a Gaussian (normal) distribution whose mean is 0 and whose standard deviation is 1. <br />                                                                                                                                                                                                                                                                          | | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)   | [nextGaussian](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextGaussian(kotlin.Double,%20kotlin.Double))`(`mean:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, `stddev:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`)` <br /> Returns a`double`value pseudorandomly chosen from a Gaussian (normal) distribution with a mean and standard deviation specified by the arguments. <br />                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [nextInt](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextInt(kotlin.Int))`(`bound:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Returns a pseudorandomly chosen`int`value between zero (inclusive) and the specified bound (exclusive). <br />                                                                                                                                                                                                                   | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [nextInt](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextInt(kotlin.Int,%20kotlin.Int))`(`origin:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `bound:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Returns a pseudorandomly chosen`int`value between the specified origin (inclusive) and the specified bound (exclusive). <br />                                                                                             | | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)       | [nextLong](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextLong(kotlin.Long))`(`bound:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> Returns a pseudorandomly chosen`long`value between zero (inclusive) and the specified bound (exclusive). <br />                                                                                                                                                                                                             | | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)       | [nextLong](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator#nextLong(kotlin.Long,%20kotlin.Long))`(`origin:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `bound:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> Returns a pseudorandomly chosen`long`value between the specified origin (inclusive) and the specified bound (exclusive). <br />                                                                                    | ||
| From class[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator) |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Stream](https://developer.android.com/reference/kotlin/java/util/stream/Stream)<[RandomGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator)!>! | [rngs](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator#rngs())`()` <br /> Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements the[RandomGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator)interface. Ideally the generators in the stream will appear to be statistically independent. <br />                                                                                                                       | | [Stream](https://developer.android.com/reference/kotlin/java/util/stream/Stream)<[RandomGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator)!>! | [rngs](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator#rngs(kotlin.Long))`(`streamSize:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> Returns a stream producing the given`streamSize`number of new pseudorandom number generators, each of which implements the[RandomGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator)interface. Ideally the generators in the stream will appear to be statistically independent. <br /> | ||

## Public constructors

### SplittableRandom

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
SplittableRandom()
```

Creates a new SplittableRandom instance that is likely to generate sequences of values that are statistically independent of those of any other instances in the current program; and may, and typically does, vary across program invocations.  

### SplittableRandom

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
SplittableRandom(seed: Long)
```

Creates a new SplittableRandom instance using the specified initial seed. SplittableRandom instances created with the same seed in the same program generate identical sequences of values.

|                                              Parameters                                               ||
|--------|-----------------------------------------------------------------------------------------------|
| `seed` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the initial seed |

## Public methods

### doubles

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun doubles(): DoubleStream!
```

Returns an effectively unlimited stream of pseudorandom`double`values from this generator and/or one split from it; each value is between zero (inclusive) and one (exclusive).

|                                                                Return                                                                 ||
|-----------------------------------------------------------------------------------------------|----------------------------------------|
| [DoubleStream](https://developer.android.com/reference/kotlin/java/util/stream/DoubleStream)! | a stream of pseudorandom`double`values |

### doubles

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun doubles(
    randomNumberOrigin: Double, 
    randomNumberBound: Double
): DoubleStream!
```

Returns an effectively unlimited stream of pseudorandom`double`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).

|                                                                     Parameters                                                                     ||
|----------------------|------------------------------------------------------------------------------------------------------------------------------|
| `randomNumberOrigin` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html):the origin (inclusive) of each random value |
| `randomNumberBound`  | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html):the bound (exclusive) of each random value  |

|                                                                                               Return                                                                                                ||
|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| [DoubleStream](https://developer.android.com/reference/kotlin/java/util/stream/DoubleStream)! | a stream of pseudorandom`double`values, each with the given origin (inclusive) and bound (exclusive) |

|                                                 Exceptions                                                 ||
|--------------------------------------|----------------------------------------------------------------------|
| `java.lang.IllegalArgumentException` | if`randomNumberOrigin`is greater than or equal to`randomNumberBound` |

### doubles

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun doubles(streamSize: Long): DoubleStream!
```

Returns a stream producing the given`streamSize`number of pseudorandom`double`values from this generator and/or one split from it; each value is between zero (inclusive) and one (exclusive).

|                                                         Parameters                                                          ||
|--------------|---------------------------------------------------------------------------------------------------------------|
| `streamSize` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the number of values to generate |

|                                                          Return                                                          ||
|-----------------------------------------------------------------------------------------------|---------------------------|
| [DoubleStream](https://developer.android.com/reference/kotlin/java/util/stream/DoubleStream)! | a stream of`double`values |

|                              Exceptions                               ||
|--------------------------------------|---------------------------------|
| `java.lang.IllegalArgumentException` | if`streamSize`is less than zero |

### doubles

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun doubles(
    streamSize: Long, 
    randomNumberOrigin: Double, 
    randomNumberBound: Double
): DoubleStream!
```

Returns a stream producing the given`streamSize`number of pseudorandom`double`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).

|                                                                     Parameters                                                                     ||
|----------------------|------------------------------------------------------------------------------------------------------------------------------|
| `streamSize`         | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the number of values to generate                |
| `randomNumberOrigin` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html):the origin (inclusive) of each random value |
| `randomNumberBound`  | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html):the bound (exclusive) of each random value  |

|                                                                                               Return                                                                                                ||
|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| [DoubleStream](https://developer.android.com/reference/kotlin/java/util/stream/DoubleStream)! | a stream of pseudorandom`double`values, each with the given origin (inclusive) and bound (exclusive) |

|                                                                 Exceptions                                                                  ||
|--------------------------------------|-------------------------------------------------------------------------------------------------------|
| `java.lang.IllegalArgumentException` | if`streamSize`is less than zero, or`randomNumberOrigin`is greater than or equal to`randomNumberBound` |

### ints

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun ints(): IntStream!
```

Returns an effectively unlimited stream of pseudorandom`int`values from this generator and/or one split from it.

|                                                            Return                                                            ||
|-----------------------------------------------------------------------------------------|-------------------------------------|
| [IntStream](https://developer.android.com/reference/kotlin/java/util/stream/IntStream)! | a stream of pseudorandom`int`values |

### ints

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun ints(
    randomNumberOrigin: Int, 
    randomNumberBound: Int
): IntStream!
```

Returns an effectively unlimited stream of pseudorandom`int`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).

|                                                                  Parameters                                                                  ||
|----------------------|------------------------------------------------------------------------------------------------------------------------|
| `randomNumberOrigin` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the origin (inclusive) of each random value |
| `randomNumberBound`  | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the bound (exclusive) of each random value  |

|                                                                                           Return                                                                                           ||
|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| [IntStream](https://developer.android.com/reference/kotlin/java/util/stream/IntStream)! | a stream of pseudorandom`int`values, each with the given origin (inclusive) and bound (exclusive) |

|                                                 Exceptions                                                 ||
|--------------------------------------|----------------------------------------------------------------------|
| `java.lang.IllegalArgumentException` | if`randomNumberOrigin`is greater than or equal to`randomNumberBound` |

### ints

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun ints(streamSize: Long): IntStream!
```

Returns a stream producing the given`streamSize`number of pseudorandom`int`values from this generator and/or one split from it.

|                                                         Parameters                                                          ||
|--------------|---------------------------------------------------------------------------------------------------------------|
| `streamSize` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the number of values to generate |

|                                                            Return                                                            ||
|-----------------------------------------------------------------------------------------|-------------------------------------|
| [IntStream](https://developer.android.com/reference/kotlin/java/util/stream/IntStream)! | a stream of pseudorandom`int`values |

|                              Exceptions                               ||
|--------------------------------------|---------------------------------|
| `java.lang.IllegalArgumentException` | if`streamSize`is less than zero |

### ints

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun ints(
    streamSize: Long, 
    randomNumberOrigin: Int, 
    randomNumberBound: Int
): IntStream!
```

Returns a stream producing the given`streamSize`number of pseudorandom`int`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).

|                                                                  Parameters                                                                  ||
|----------------------|------------------------------------------------------------------------------------------------------------------------|
| `streamSize`         | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the number of values to generate          |
| `randomNumberOrigin` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the origin (inclusive) of each random value |
| `randomNumberBound`  | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the bound (exclusive) of each random value  |

|                                                                                           Return                                                                                           ||
|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| [IntStream](https://developer.android.com/reference/kotlin/java/util/stream/IntStream)! | a stream of pseudorandom`int`values, each with the given origin (inclusive) and bound (exclusive) |

|                                                                 Exceptions                                                                  ||
|--------------------------------------|-------------------------------------------------------------------------------------------------------|
| `java.lang.IllegalArgumentException` | if`streamSize`is less than zero, or`randomNumberOrigin`is greater than or equal to`randomNumberBound` |

### longs

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun longs(): LongStream!
```

Returns an effectively unlimited stream of pseudorandom`long`values from this generator and/or one split from it.

|                                                             Return                                                              ||
|-------------------------------------------------------------------------------------------|--------------------------------------|
| [LongStream](https://developer.android.com/reference/kotlin/java/util/stream/LongStream)! | a stream of pseudorandom`long`values |

### longs

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun longs(streamSize: Long): LongStream!
```

Returns a stream producing the given`streamSize`number of pseudorandom`long`values from this generator and/or one split from it.

|                                                         Parameters                                                          ||
|--------------|---------------------------------------------------------------------------------------------------------------|
| `streamSize` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the number of values to generate |

|                                                             Return                                                              ||
|-------------------------------------------------------------------------------------------|--------------------------------------|
| [LongStream](https://developer.android.com/reference/kotlin/java/util/stream/LongStream)! | a stream of pseudorandom`long`values |

|                              Exceptions                               ||
|--------------------------------------|---------------------------------|
| `java.lang.IllegalArgumentException` | if`streamSize`is less than zero |

### longs

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun longs(
    randomNumberOrigin: Long, 
    randomNumberBound: Long
): LongStream!
```

Returns an effectively unlimited stream of pseudorandom`long`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).

|                                                                   Parameters                                                                   ||
|----------------------|--------------------------------------------------------------------------------------------------------------------------|
| `randomNumberOrigin` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the origin (inclusive) of each random value |
| `randomNumberBound`  | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the bound (exclusive) of each random value  |

|                                                                                            Return                                                                                             ||
|-------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| [LongStream](https://developer.android.com/reference/kotlin/java/util/stream/LongStream)! | a stream of pseudorandom`long`values, each with the given origin (inclusive) and bound (exclusive) |

|                                                 Exceptions                                                 ||
|--------------------------------------|----------------------------------------------------------------------|
| `java.lang.IllegalArgumentException` | if`randomNumberOrigin`is greater than or equal to`randomNumberBound` |

### longs

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun longs(
    streamSize: Long, 
    randomNumberOrigin: Long, 
    randomNumberBound: Long
): LongStream!
```

Returns a stream producing the given`streamSize`number of pseudorandom`long`values from this generator and/or one split from it; each value conforms to the given origin (inclusive) and bound (exclusive).

|                                                                   Parameters                                                                   ||
|----------------------|--------------------------------------------------------------------------------------------------------------------------|
| `streamSize`         | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the number of values to generate            |
| `randomNumberOrigin` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the origin (inclusive) of each random value |
| `randomNumberBound`  | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the bound (exclusive) of each random value  |

|                                                                                            Return                                                                                             ||
|-------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| [LongStream](https://developer.android.com/reference/kotlin/java/util/stream/LongStream)! | a stream of pseudorandom`long`values, each with the given origin (inclusive) and bound (exclusive) |

|                                                                 Exceptions                                                                  ||
|--------------------------------------|-------------------------------------------------------------------------------------------------------|
| `java.lang.IllegalArgumentException` | if`streamSize`is less than zero, or`randomNumberOrigin`is greater than or equal to`randomNumberBound` |

### nextBytes

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun nextBytes(bytes: ByteArray!): Unit
```

Fills a user-supplied byte array with generated byte values pseudorandomly chosen uniformly from the range of values between -128 (inclusive) and 127 (inclusive).

|                                                                    Parameters                                                                    ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
| `bytes` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)!:the byte array to fill with pseudorandom bytes |

|                     Exceptions                     ||
|----------------------------------|------------------|
| `java.lang.NullPointerException` | if bytes is null |

### nextInt

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun nextInt(): Int
```

|                                                    Return                                                     ||
|----------------------------------------------------------------------------|-----------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a pseudorandomly chosen`int`value |

### nextLong

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun nextLong(): Long
```

|                                                      Return                                                      ||
|------------------------------------------------------------------------------|------------------------------------|
| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | a pseudorandomly chosen`long`value |

### split

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun split(): SplittableRandom!
```

Constructs and returns a new SplittableRandom instance that shares no mutable state with this instance. However, with very high probability, the set of values collectively generated by the two objects has the same statistical properties as if the same quantity of values were generated by a single thread using a single SplittableRandom object. Either or both of the two objects may be further split using the`split()`method, and the same expected statistical properties apply to the entire set of generators constructed by such recursive splitting.

|                                                               Return                                                               ||
|-------------------------------------------------------------------------------------------------|-----------------------------------|
| [SplittableRandom](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#)! | the new SplittableRandom instance |

### split

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun split(source: RandomGenerator.SplittableGenerator!): SplittableRandom!
```

Returns a new pseudorandom number generator, split off from this one, that implements the[RandomGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator)and[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interfaces.

|                                                                                                                                                                                               Parameters                                                                                                                                                                                                ||
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source` | [RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!:a[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)instance to be used instead of this one as a source of pseudorandom bits used to initialize the state of the new ones. |

|                                                                                                                                                                                 Return                                                                                                                                                                                  ||
|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SplittableRandom](https://developer.android.com/reference/kotlin/java/util/SplittableRandom#)! | an object that implements the[RandomGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator)and[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interfaces |

|                     Exceptions                      ||
|----------------------------------|-------------------|
| `java.lang.NullPointerException` | if source is null |

### splits

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun splits(): Stream<RandomGenerator.SplittableGenerator!>!
```

Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements the[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interface.

This pseudorandom number generator may be used as a source of pseudorandom bits used to initialize the state the new ones.

|                                                                                                                                                                                    Return                                                                                                                                                                                    ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| [Stream](https://developer.android.com/reference/kotlin/java/util/stream/Stream)<[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!>! | a stream of[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)objects |

### splits

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun splits(source: RandomGenerator.SplittableGenerator!): Stream<RandomGenerator.SplittableGenerator!>!
```

Returns an effectively unlimited stream of new pseudorandom number generators, each of which implements the[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interface.

|                                                                                                                                                                                               Parameters                                                                                                                                                                                                ||
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `source` | [RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!:a[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)instance to be used instead of this one as a source of pseudorandom bits used to initialize the state of the new ones. |

|                                                                                                                                                                                    Return                                                                                                                                                                                    ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| [Stream](https://developer.android.com/reference/kotlin/java/util/stream/Stream)<[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!>! | a stream of[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)objects |

|                     Exceptions                      ||
|----------------------------------|-------------------|
| `java.lang.NullPointerException` | if source is null |

### splits

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun splits(streamSize: Long): Stream<RandomGenerator.SplittableGenerator!>!
```

Returns a stream producing the given`streamSize`number of new pseudorandom number generators, each of which implements the[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interface.

This pseudorandom number generator may be used as a source of pseudorandom bits used to initialize the state the new ones.

|                                                         Parameters                                                          ||
|--------------|---------------------------------------------------------------------------------------------------------------|
| `streamSize` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the number of values to generate |

|                                                                                                                                                                                    Return                                                                                                                                                                                    ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| [Stream](https://developer.android.com/reference/kotlin/java/util/stream/Stream)<[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!>! | a stream of[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)objects |

|                              Exceptions                               ||
|--------------------------------------|---------------------------------|
| `java.lang.IllegalArgumentException` | if`streamSize`is less than zero |

### splits

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun splits(
    streamSize: Long, 
    source: RandomGenerator.SplittableGenerator!
): Stream<RandomGenerator.SplittableGenerator!>!
```

Returns a stream producing the given`streamSize`number of new pseudorandom number generators, each of which implements the[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)interface.

|                                                                                                                                                                                                 Parameters                                                                                                                                                                                                  ||
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `streamSize` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):the number of values to generate                                                                                                                                                                                                                                                                                 |
| `source`     | [RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!:a[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)instance to be used instead of this one as a source of pseudorandom bits used to initialize the state of the new ones. |

|                                                                                                                                                                                    Return                                                                                                                                                                                    ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| [Stream](https://developer.android.com/reference/kotlin/java/util/stream/Stream)<[RandomGenerator.SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)!>! | a stream of[SplittableGenerator](https://developer.android.com/reference/kotlin/java/util/random/RandomGenerator.SplittableGenerator)objects |

|                              Exceptions                               ||
|--------------------------------------|---------------------------------|
| `java.lang.IllegalArgumentException` | if`streamSize`is less than zero |
| `java.lang.NullPointerException`     | if source is null               |