net.i2p.util

## Class PooledRandomSource

- java.lang.Object
- - java.util.Random
  - - java.security.SecureRandom
    - - net.i2p.util.RandomSource
      - - net.i2p.util.PooledRandomSource

All Implemented Interfaces:
  Serializable, EntropyHarvester

Deprecated.
Unused! See FortunaRandomSource

    public class PooledRandomSource
    extends RandomSource

Maintain a set of PRNGs to feed the apps

See Also:
  Serialized Form

### Field Summary

Fields
`protected int` `_nextPool` Deprecated.
`protected RandomSource[]` `_pool` Deprecated.
`static int` `POOL_SIZE` Deprecated.
`static String` `PROP_BUFFER_SIZE` Deprecated. How much random data will we precalculate and feed from (as opposed to on demand reseeding, etc).

### Fields inherited from class net.i2p.util.RandomSource

`_context`

### Constructor Summary

Constructors
Constructor and Description
`PooledRandomSource(I2PAppContext context)` Deprecated.

### Method Summary

Methods
`EntropyHarvester` `harvester()` Deprecated.
`protected void` `initializePool(I2PAppContext context)` Deprecated.
`boolean` `nextBoolean()` Deprecated. override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)
`void` `nextBytes(byte[] buf)` Deprecated. override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)
`double` `nextDouble()` Deprecated. override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)
`float` `nextFloat()` Deprecated. override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)
`double` `nextGaussian()` Deprecated. override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)
`int` `nextInt()` Deprecated. override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)
`int` `nextInt(int n)` Deprecated. According to the java docs (http://java.sun.com/j2se/1.4.1/docs/api/java/util/Random.html#nextInt(int)) nextInt(n) should return a number between 0 and n (including 0 and excluding n).
`long` `nextLong()` Deprecated. override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)
`long` `nextLong(long n)` Deprecated. Like the modified nextInt, nextLong(n) returns a random number from 0 through n, including 0, excluding n.

### Methods inherited from class net.i2p.util.RandomSource

`feedEntropy, feedEntropy, getInstance, initSeed, loadSeed, main, saveSeed, writeSeed`

### Methods inherited from class java.security.SecureRandom

`generateSeed, getAlgorithm, getInstance, getInstance, getInstance, getProvider, getSeed, next, setSeed, setSeed`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### _pool

    protected RandomSource[] _pool

Deprecated.

#### _nextPool

    protected volatile int _nextPool

Deprecated.

#### POOL_SIZE

    public static final int POOL_SIZE

Deprecated.

See Also:
  Constant Field Values

#### PROP_BUFFER_SIZE

    public static final String PROP_BUFFER_SIZE

Deprecated.
How much random data will we precalculate and feed from (as opposed to on demand reseeding, etc). If this is not set, a default will be used (4MB), or if it is set to 0, no buffer will be used, otherwise the amount specified will be allocated across the pooled PRNGs.

See Also:
  Constant Field Values

### Constructor Detail

#### PooledRandomSource

    public PooledRandomSource(I2PAppContext context)

Deprecated.

### Method Detail

#### initializePool

    protected void initializePool(I2PAppContext context)

Deprecated.

#### nextInt

    public int nextInt(int n)

Deprecated.
According to the java docs (http://java.sun.com/j2se/1.4.1/docs/api/java/util/Random.html#nextInt(int)) nextInt(n) should return a number between 0 and n (including 0 and excluding n). However, their pseudocode, as well as sun's, kaffe's, and classpath's implementation INCLUDES NEGATIVE VALUES. WTF. Ok, so we're going to have it return between 0 and n (including 0, excluding n), since thats what it has been used for.

Overrides:
  `nextInt` in class `RandomSource`

#### nextLong

    public long nextLong(long n)

Deprecated.
Like the modified nextInt, nextLong(n) returns a random number from 0 through n, including 0, excluding n.

Overrides:
  `nextLong` in class `RandomSource`

#### nextBoolean

    public boolean nextBoolean()

Deprecated.
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)

Overrides:
  `nextBoolean` in class `Random`

#### nextBytes

    public void nextBytes(byte[] buf)

Deprecated.
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)

Overrides:
  `nextBytes` in class `SecureRandom`

#### nextDouble

    public double nextDouble()

Deprecated.
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)

Overrides:
  `nextDouble` in class `Random`

#### nextFloat

    public float nextFloat()

Deprecated.
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)

Overrides:
  `nextFloat` in class `Random`

#### nextGaussian

    public double nextGaussian()

Deprecated.
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)

Overrides:
  `nextGaussian` in class `Random`

#### nextInt

    public int nextInt()

Deprecated.
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)

Overrides:
  `nextInt` in class `Random`

#### nextLong

    public long nextLong()

Deprecated.
override as synchronized, for those JVMs that don't always pull via nextBytes (cough ibm)

Overrides:
  `nextLong` in class `Random`

#### harvester

    public EntropyHarvester harvester()

Deprecated.

Overrides:
  `harvester` in class `RandomSource`