Class EmptyInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    class EmptyInputStream
    extends java.io.InputStream
    The EmptyInputStream object provides a stream that is immediately empty. Each read method with this input stream will return a -1 value indicating that the stream has come to an end and no more data can be read from it.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int read()
      This is used to provide a -1 value when an attempt is made to read from the stream.
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EmptyInputStream

        EmptyInputStream()
    • Method Detail

      • read

        public int read()
        This is used to provide a -1 value when an attempt is made to read from the stream. Implementing this method as so also ensures that all the other read methods return a -1 value.
        Specified by:
        read in class java.io.InputStream
        Returns:
        this returns a -1 when an attempt is made to read