net.sf.mmm.util.io.api
Class DevZero

java.lang.Object
  extended by java.io.InputStream
      extended by net.sf.mmm.util.io.api.DevZero
All Implemented Interfaces:
Closeable

public final class DevZero
extends InputStream

This is an implementation of /dev/zero as InputStream. In other words the DevZero is a dummy InputStream that produces infinite zeros.
ATTENTION:
Please be careful NOT to cause infinity loops when using this class!

Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
static DevZero INSTANCE
          The singleton instance.
 
Constructor Summary
private DevZero()
          The constructor.
 
Method Summary
 void close()
          
 int read()
          
 int read(byte[] b, int off, int len)
          
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DevZero INSTANCE
The singleton instance.

Constructor Detail

DevZero

private DevZero()
The constructor.

Method Detail

read

public int read()
         throws IOException

Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)

Overrides:
read in class InputStream

close

public void close()

Specified by:
close in interface Closeable
Overrides:
close in class InputStream


Copyright © 2001-2010 mmm-Team. All Rights Reserved.