org.mmbase.util
Class NullInputStream

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

public class NullInputStream
extends MockInputStream

An input stream only producing zeros. Not costing any memory though.

Since:
MMBase-1.9.2
Version:
$Id: NullInputStream.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
NullInputStream()
          Produces an immense amount of zeros
NullInputStream(int l)
          This input stream produces a given number of zeros.
 
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

NullInputStream

public NullInputStream(int l)
This input stream produces a given number of zeros.

Parameters:
l - How long this input stream will be

NullInputStream

public NullInputStream()
Produces an immense amount of zeros

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