public class BrokenOutputStream extends OutputStream
IOException from
all OutputStream methods.
This class is mostly useful for testing error handling in code that uses an output stream.
| 构造器和说明 |
|---|
BrokenOutputStream()
Creates a new stream that always throws an
IOException |
BrokenOutputStream(IOException exception)
Creates a new stream that always throws the given exception.
|
public BrokenOutputStream(IOException exception)
exception - the exception to be thrownpublic BrokenOutputStream()
IOExceptionpublic void write(int b)
throws IOException
write 在类中 OutputStreamb - ignoredIOException - always thrownpublic void flush()
throws IOException
flush 在接口中 Flushableflush 在类中 OutputStreamIOException - always thrownpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 OutputStreamIOException - always thrown