org.clazzes.optional.sec
Class NativeRandomGenerator

java.lang.Object
  extended by org.clazzes.optional.sec.NativeRandomGenerator
All Implemented Interfaces:
RandomGenerator

public class NativeRandomGenerator
extends java.lang.Object
implements RandomGenerator

A random generator, which uses the JRE implementation of a secure random generator. This class is thread-safe, so it may be used as a singleton.


Constructor Summary
NativeRandomGenerator()
           
 
Method Summary
 void nextBytes(byte[] bytes)
          Fill bytes with random values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeRandomGenerator

public NativeRandomGenerator()
Method Detail

nextBytes

public void nextBytes(byte[] bytes)
Description copied from interface: RandomGenerator
Fill bytes with random values.

Specified by:
nextBytes in interface RandomGenerator
Parameters:
bytes - byte array to be filled.


Copyright © 2010. All Rights Reserved.