org.mmbase.util
Class RandomInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.mmbase.util.MockInputStream
          extended by org.mmbase.util.RandomInputStream
All Implemented Interfaces:
Closeable

public class RandomInputStream
extends MockInputStream

An input stream only producing random bytes. Not costing any memory though.

Since:
MMBase-1.9.2
Version:
$Id: RandomInputStream.java 41055 2010-02-15 23:59:16Z michiel $
Author:
Michiel Meeuwissen

Field Summary
 
Fields inherited from class org.mmbase.util.MockInputStream
closed
 
Constructor Summary
RandomInputStream()
          Produces an immense amount of randomness
RandomInputStream(int l)
          This input stream produces a given number of random number.
 
Method Summary
protected  void fillArray(byte[] data, int offset, int l)
           
protected  int oneByte()
           
 
Methods inherited from class org.mmbase.util.MockInputStream
available, close, read, read, skip
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomInputStream

public RandomInputStream(int l)
This input stream produces a given number of random number.

Parameters:
l - How long this input stream will be

RandomInputStream

public RandomInputStream()
Produces an immense amount of randomness

Method Detail

oneByte

protected int oneByte()
Specified by:
oneByte in class MockInputStream

fillArray

protected void fillArray(byte[] data,
                         int offset,
                         int l)
Specified by:
fillArray in class MockInputStream


MMBase 2.0-SNAPSHOT - null