Package org.forgerock.http.io
Class FailableInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.forgerock.http.io.FailableInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
Wraps an existing
InputStream
, supporting a failed state that is checked before and after each operation.-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
-
Method Summary
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
FailableInputStream
Constructs a newFailableInputStream
.- Parameters:
in
- the underlying input stream
-
-
Method Details
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classFilterInputStream
- Throws:
IOException
-
reset
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
setFailed
Sets this stream into a failed state.- Parameters:
cause
- The cause of the failure.
-