? BrokenInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.io.input.BrokenInputStream
- ????????:
Closeable
,AutoCloseable
Broken input stream. This stream always throws an
IOException
from
all the InputStream
methods where the exception is declared.
This class is mostly useful for testing error handling in code that uses an input stream.
- ???????:
- 2.0
-
?????
????????Creates a new stream that always throws anIOException
BrokenInputStream
(IOException exception) Creates a new stream that always throws the given exception. -
????
??????? java.io.InputStream
mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
???????
-
BrokenInputStream
Creates a new stream that always throws the given exception.- ??:
exception
- the exception to be thrown
-
BrokenInputStream
public BrokenInputStream()Creates a new stream that always throws anIOException
-
-
??????
-
read
Throws the configured exception.- ???:
read
???InputStream
- ??:
- nothing
- ??:
IOException
- always thrown
-
available
Throws the configured exception.- ??:
available
???InputStream
- ??:
- nothing
- ??:
IOException
- always thrown
-
skip
Throws the configured exception.- ??:
skip
???InputStream
- ??:
n
- ignored- ??:
- nothing
- ??:
IOException
- always thrown
-
reset
Throws the configured exception.- ??:
reset
???InputStream
- ??:
IOException
- always thrown
-
close
Throws the configured exception.- ???:
close
????AutoCloseable
- ???:
close
????Closeable
- ??:
close
???InputStream
- ??:
IOException
- always thrown
-