com.dalsemi.comm
Class NullInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--com.dalsemi.comm.NullInputStream
- public class NullInputStream
- extends InputStream
This class is used when data is requested for input but
a port is not currently available. This class is used when the
java.lang.System
class initializes.
System.in
is initialized to a NullInputStream
so that system initialization routines do not have to open
any devices.
This class is also useful in other instances. In Slush, if a
process is run in the background and the input streams are not redirected
from a file or some other source, the background process should not be allowed
to share the standard input stream System.in
. In this case,
the background process is created with a NullInputStream
as its
standard input.
This class duplicates the behavior of a closed stream.
- See Also:
NullOutputStream
Method Summary |
int |
read()
Reads a byte of data from this NullInputStream . |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
NullInputStream
public NullInputStream()
read
public int read()
- Reads a byte of data from this
NullInputStream
. The value
-1
is returned, indicating the stream is closed
and no more data will be available.
- Overrides:
- read in class InputStream
- Returns:
-1
, indicating this stream has no more
input data