Class EmptyInputStream

java.lang.Object
java.io.InputStream
org.simpleframework.http.message.EmptyInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

class EmptyInputStream extends 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.
  • Constructor Details

    • EmptyInputStream

      EmptyInputStream()
  • Method Details

    • 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 InputStream
      Returns:
      this returns a -1 when an attempt is made to read