public class BrokenInputStream extends InputStream
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.
| 构造器和说明 |
|---|
BrokenInputStream()
Creates a new stream that always throws an
IOException |
BrokenInputStream(IOException exception)
Creates a new stream that always throws the given exception.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
available()
Throws the configured exception.
|
void |
close()
Throws the configured exception.
|
int |
read()
Throws the configured exception.
|
void |
reset()
Throws the configured exception.
|
long |
skip(long n)
Throws the configured exception.
|
mark, markSupported, read, readpublic BrokenInputStream(IOException exception)
exception - the exception to be thrownpublic BrokenInputStream()
IOExceptionpublic int read()
throws IOException
read 在类中 InputStreamIOException - always thrownpublic int available()
throws IOException
available 在类中 InputStreamIOException - always thrownpublic long skip(long n)
throws IOException
skip 在类中 InputStreamn - ignoredIOException - always thrownpublic void reset()
throws IOException
reset 在类中 InputStreamIOException - always thrownpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 InputStreamIOException - always thrown