? BrokenReader
java.lang.Object
java.io.Reader
org.apache.commons.io.input.BrokenReader
- ????????:
Closeable
,AutoCloseable
,Readable
Broken reader. This reader always throws an
IOException
from
all the Reader
methods where the exception is declared.
This class is mostly useful for testing error handling in code that uses a reader.
- ???????:
- 2.7
-
????
-
?????
????????Creates a new reader that always throws anIOException
BrokenReader
(IOException exception) Creates a new reader that always throws the given exception. -
????
??????????void
close()
Throws the configured exception.void
mark
(int readAheadLimit) Throws the configured exception.int
read
(char[] cbuf, int off, int len) Throws the configured exception.boolean
ready()
Throws the configured exception.void
reset()
Throws the configured exception.long
skip
(long n) Throws the configured exception.??????? java.io.Reader
markSupported, nullReader, read, read, read, transferTo
-
???????
-
BrokenReader
Creates a new reader that always throws the given exception.- ??:
exception
- the exception to be thrown
-
BrokenReader
public BrokenReader()Creates a new reader that always throws anIOException
-
-
??????
-
read
Throws the configured exception.- ???:
read
???Reader
- ??:
cbuf
- ignoredoff
- ignoredlen
- ignored- ??:
- nothing
- ??:
IOException
- always thrown
-
skip
Throws the configured exception.- ??:
skip
???Reader
- ??:
n
- ignored- ??:
- nothing
- ??:
IOException
- always thrown
-
ready
Throws the configured exception.- ??:
ready
???Reader
- ??:
- nothing
- ??:
IOException
- always thrown
-
mark
Throws the configured exception.- ??:
mark
???Reader
- ??:
readAheadLimit
- ignored- ??:
IOException
- always thrown
-
reset
Throws the configured exception.- ??:
reset
???Reader
- ??:
IOException
- always thrown
-
close
Throws the configured exception.- ???:
close
????AutoCloseable
- ???:
close
????Closeable
- ???:
close
???Reader
- ??:
IOException
- always thrown
-