All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class is.logi.crypto.random.RandomFromReader

java.lang.Object
   |
   +----java.util.Random
           |
           +----is.logi.crypto.random.RandomFromReader

public class RandomFromReader
extends Random
This class reads bits from a Reader object and returns them as random values. No randomness checking is done and an Error is thrown if the end of the Reader is ever reached.

This class is useful f.ex. for reding random bits from the /dev/random or /dev/urandom deviced in linux. This would be done with the following code:

 Random rand;
 try {
   rand=new RandomFromReader(new FileReader("/dev/random"));
 } catch (FileNotFoundException e) {
   rand=new RandomSpinner();
 }
 

Author:
Logi Ragnarsson (logir@hi.is)

Constructor Index

 o RandomFromReader(Reader)
Create a new RandomFromReader obejct.

Constructors

 o RandomFromReader
 public RandomFromReader(Reader r)
Create a new RandomFromReader obejct. Random bits are read from r


All Packages  Class Hierarchy  This Package  Previous  Next  Index