Package org.simpleframework.http.message
Class EmptyInputStream
java.lang.Object
java.io.InputStream
org.simpleframework.http.message.EmptyInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
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, skipNBytes, transferTo
-
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 classInputStream
- Returns:
- this returns a -1 when an attempt is made to read
-