iaik.security.random
Class RandomInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--iaik.security.random.RandomInputStream

public class RandomInputStream
extends InputStream

An InputStream that reads data from a Random number generator. The Random number generator can be java.util.Random or one of its subclasses java.security.SecureRandom, iaik.security.random.SecRandom, etc.

Version:
File Revision 12
See Also:
SecRandom

Constructor Summary
RandomInputStream(Random random)
          Create a new RandomInputStream that reads from the specified random number generator.
 
Method Summary
 int available()
          Return the number of bytes available for a non-blocking read from this stream.
 int read()
          Read one byte and return it.
 int read(byte[] b)
          Read b.length bytes.
 int read(byte[] b, int off, int len)
          Read len bytes into b.
 
Methods inherited from class java.io.InputStream
close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomInputStream

public RandomInputStream(Random random)
Create a new RandomInputStream that reads from the specified random number generator.
Method Detail

read

public int read(byte[] b)
Read b.length bytes.
Overrides:
read in class InputStream

read

public int read(byte[] b,
                int off,
                int len)
Read len bytes into b.
Overrides:
read in class InputStream

read

public int read()
Read one byte and return it.
Overrides:
read in class InputStream

available

public int available()
Return the number of bytes available for a non-blocking read from this stream. As the stream is of unlimited length, we return Integer.MAX_VALUE (231 - 1). This method never throws an IOException.
Overrides:
available in class InputStream

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK