public class

SingletonRandomFactory

extends Object
implements Factory<T> Random
java.lang.Object
   ↳ net.schmizz.sshj.transport.random.SingletonRandomFactory

Class Overview

A random factory wrapper that uses a single random instance. The underlying random instance has to be thread safe.

Summary

Fields
private final Random random
Public Constructors
SingletonRandomFactory(Factory<Random> factory)
Public Methods
Random create()
void fill(byte[] bytes, int start, int len)
Fill part of bytes with random values.
[Expand]
Inherited Methods
From class java.lang.Object
From interface net.schmizz.sshj.common.Factory
From interface net.schmizz.sshj.transport.random.Random

Fields

private final Random random

Public Constructors

public SingletonRandomFactory (Factory<Random> factory)

Parameters
factory

Public Methods

public Random create ()

public void fill (byte[] bytes, int start, int len)

Fill part of bytes with random values.

Parameters
bytes Byte array to be filled.
start Index to start filling at.
len Length of segment to fill.