|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream tribble.io.NullInputStream
public class NullInputStream
Null input stream.
A stream which contains no data, i.e., it always returns end-of-file when attempts are made to read from it. This is similar to the Unix/POSIX /dev/null device or the MS-DOS nul file.
Note that none of the methods throw an IOException.
NullOutputStream
Field Summary | |
---|---|
static NullInputStream |
NULL_IN
A null input stream. |
(package private) static java.lang.String |
REV
Revision information. |
Constructor Summary | |
---|---|
NullInputStream()
Default constructor. |
Method Summary | |
---|---|
int |
read()
Read a byte from this (empty) stream. |
int |
read(byte[] buf)
Read a set of bytes from this (empty) stream. |
int |
read(byte[] buf,
int off,
int len)
Read a set of bytes from this (empty) stream. |
long |
skip(long n)
Skip (discard) a number of bytes from this (empty) stream. |
Methods inherited from class java.io.InputStream |
---|
available, close, mark, markSupported, reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final java.lang.String REV
public static NullInputStream NULL_IN
Constructor Detail |
---|
public NullInputStream()
Method Detail |
---|
public int read()
Note that this method never throws an IOException.
read
in class java.io.InputStream
public int read(byte[] buf)
Note that this method never throws an IOException.
read
in class java.io.InputStream
buf
- An array of bytes to be read.
The contents of this are not modified.
public int read(byte[] buf, int off, int len)
Note that this method never throws an IOException.
read
in class java.io.InputStream
buf
- An array of bytes to be read.
The contents of this are not modified.off
- Index of the first byte in buf to read.len
- Number of bytes in buf to read.
This is ignored.
public long skip(long n)
Note that this method never throws an IOException.
skip
in class java.io.InputStream
n
- The number of input bytes to skip.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |