? BrokenWriter
java.lang.Object
java.io.Writer
org.apache.commons.io.output.BrokenWriter
- ????????:
Closeable
,Flushable
,Appendable
,AutoCloseable
Broken writer. This writer always throws an
IOException
from
all Writer
methods.
This class is mostly useful for testing error handling in code that uses a writer.
- ???????:
- 2.0
-
????
-
?????
????????Creates a new writer that always throws anIOException
BrokenWriter
(IOException exception) Creates a new writer that always throws the given exception. -
????
-
???????
-
BrokenWriter
Creates a new writer that always throws the given exception.- ??:
exception
- the exception to be thrown
-
BrokenWriter
public BrokenWriter()Creates a new writer that always throws anIOException
-
-
??????
-
write
Throws the configured exception.- ???:
write
???Writer
- ??:
cbuf
- ignoredoff
- ignoredlen
- ignored- ??:
IOException
- always thrown
-
flush
Throws the configured exception.- ???:
flush
????Flushable
- ???:
flush
???Writer
- ??:
IOException
- always thrown
-
close
Throws the configured exception.- ???:
close
????AutoCloseable
- ???:
close
????Closeable
- ???:
close
???Writer
- ??:
IOException
- always thrown
-