Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.emory.mathcs.util.io
Class NullInputStream

    java.lang.Object
      java.io.InputStream
          edu.emory.mathcs.util.io.NullInputStream

All Implemented Interfaces:
  Input

public class NullInputStream
extends java.io.InputStream
implements Input

Input stream that is always at EOF. Similar to /dev/null. Useful when there is a need to indicate "no data" while the data is expected to have the form of an input stream.

Version:
  1.0
Author:
  Dawid Kurzyniec

Constructor Summary
`NullInputStream()` Creates a new NullInputStream that is always at EOF.

Method Summary
`int` | `available()` Returns 0.
`int` | `read()` Returns -1.
`int` | `read(byte[] buf)` Returns -1.
`int` | `read(byte[] buf, int off, int len)` Returns -1.
`long` | `skip(long n)` Returns 0.

Methods inherited from class java.io.InputStream
`close, mark, markSupported, reset`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface edu.emory.mathcs.util.io.Input
`close, mark, markSupported, reset`

Constructor Detail

### NullInputStream

    public NullInputStream()

  Creates a new NullInputStream that is always at EOF.

Method Detail

### read

    public int read()

  Returns -1.

  Specified by:
    `read` in interface `Input`

### read

    public int read(byte[] buf)

  Returns -1.

  Specified by:
    `read` in interface `Input`

### read

    public int read(byte[] buf,
                    int off,
                    int len)

  Returns -1.

  Specified by:
    `read` in interface `Input`

### available

    public int available()

  Returns 0.

  Specified by:
    `available` in interface `Input`

### skip

    public long skip(long n)

  Returns 0.

  Specified by:
    `skip` in interface `Input`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD