org.jboss.util.stream
Class NullInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.jboss.util.stream.NullInputStream

public final class NullInputStream
extends java.io.InputStream

A null InputStream. Methods that return values, return values that indicate that there is no more data to be read, other methods are non-operations.


Field Summary
static NullInputStream (src) INSTANCE
          A default null input stream.
 
Constructor Summary
NullInputStream()
           
 
Method Summary
 int available()
          Always returns zero.
 void close()
          Non-operation.
 void mark(int readLimit)
          Non-operation.
 boolean markSupported()
          Always returns false.
 int read()
          Always returns -1.
 int read(byte[] bytes)
          Always returns -1.
 int read(byte[] bytes, int offset, int length)
          Always returns -1.
 void reset()
          Non-operation.
 long skip(long n)
          Always returns zero.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final NullInputStream (src)  INSTANCE
A default null input stream.

Constructor Detail

NullInputStream

public NullInputStream()
Method Detail

available

public int available()
Always returns zero.

Returns:
Zero.

mark

public void mark(int readLimit)
Non-operation.


markSupported

public boolean markSupported()
Always returns false.

Returns:
False.

reset

public void reset()
Non-operation.


close

public void close()
Non-operation.


read

public int read()
Always returns -1.

Returns:
-1.

read

public int read(byte[] bytes,
                int offset,
                int length)
Always returns -1.

Returns:
-1.

read

public int read(byte[] bytes)
Always returns -1.

Returns:
-1.

skip

public long skip(long n)
Always returns zero.

Returns:
Zero.