net.schmizz.sshj.transport.random
Class SingletonRandomFactory

java.lang.Object
  extended by net.schmizz.sshj.transport.random.SingletonRandomFactory
All Implemented Interfaces:
Factory<Random>, Random

public class SingletonRandomFactory
extends Object
implements Random, Factory<Random>

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


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.schmizz.sshj.common.Factory
Factory.Named<T>
 
Constructor Summary
SingletonRandomFactory(Factory<Random> factory)
           
 
Method Summary
 Random create()
           
 void fill(byte[] bytes, int start, int len)
          Fill part of bytes with random values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonRandomFactory

public SingletonRandomFactory(Factory<Random> factory)
Method Detail

create

public Random create()
Specified by:
create in interface Factory<Random>
Returns:
a new object created using this factory.

fill

public void fill(byte[] bytes,
                 int start,
                 int len)
Description copied from interface: Random
Fill part of bytes with random values.

Specified by:
fill in interface Random
Parameters:
bytes - byte array to be filled.
start - index to start filling at.
len - length of segment to fill.


Copyright © 2009-2012. All Rights Reserved.