Class ClosedInputStream

java.lang.Object
java.io.InputStream
org.eclipse.nebula.widgets.picture.internal.input.ClosedInputStream
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

public class ClosedInputStream
extends java.io.InputStream
Closed input stream. This stream returns -1 to all attempts to read something from the stream.

Typically uses of this class include testing for corner cases in methods that accept input streams and acting as a sentinel value instead of a null input stream.

Since:
Commons IO 1.4
Version:
$Id: ClosedInputStream.java 659817 2008-05-24 13:23:10Z niallp $
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static ClosedInputStream CLOSED_INPUT_STREAM
    A singleton.
  • Constructor Summary

    Constructors 
    Constructor Description
    ClosedInputStream()  
  • Method Summary

    Modifier and Type Method Description
    int read()
    Returns -1 to indicate that the stream is closed.

    Methods inherited from class java.io.InputStream

    available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • read

      public int read()
      Returns -1 to indicate that the stream is closed.
      Specified by:
      read in class java.io.InputStream
      Returns:
      always -1