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.
Constructor and Description |
---|
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()
IOException
public void write(int b) throws IOException
write
in class OutputStream
b
- ignoredIOException
- always thrownpublic void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
- always thrownpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
- always thrownCopyright © 2002–2016 The Apache Software Foundation. All rights reserved.