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