Sharkysoft home

lava.io
Class NullInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--lava.io.NullInputStream

public class NullInputStream
extends java.io.InputStream

Empty input stream.

Details: NullInputStream is an empty (zero-length) input stream with no contents. The first call to read immediately returns the EOS token (-1).

Since:
2000.02.10
Author:
Sharky

Constructor Summary
NullInputStream()
           
 
Method Summary
 boolean markSupported()
          True.
 int read()
          Returns EOS token.
 void reset()
          No operation.
 
Methods inherited from class java.io.InputStream
available, close, mark, read, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullInputStream

public NullInputStream()
Method Detail

read

public int read()
Returns EOS token.

Details: read returns -1, the end-of-stream token.

Overrides:
read in class java.io.InputStream
Returns:
-1

markSupported

public boolean markSupported()
True.

Details: markSupported returns true, since it is trivial to mark a position within a zero-length input stream.

Overrides:
markSupported in class java.io.InputStream
Returns:
true

reset

public void reset()
No operation.

Details: reset does absolutely nothing.

Overrides:
reset in class java.io.InputStream

Sharkysoft home