net.sf.mmm.util.io.api
Class DevZero
java.lang.Object
java.io.InputStream
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)
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.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final DevZero INSTANCE
- The singleton instance.
DevZero
private DevZero()
- The constructor.
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.