|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
org.apache.commons.io.output.BrokenOutputStream
public class BrokenOutputStream
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.
| Field Summary | |
|---|---|
private java.io.IOException |
exception
The exception that is thrown by all methods of this class. |
| Constructor Summary | |
|---|---|
BrokenOutputStream()
Creates a new stream that always throws an IOException |
|
BrokenOutputStream(java.io.IOException exception)
Creates a new stream that always throws the given exception. |
|
| Method Summary | |
|---|---|
void |
close()
Throws the configured exception. |
void |
flush()
Throws the configured exception. |
void |
write(int b)
Throws the configured exception. |
| Methods inherited from class java.io.OutputStream |
|---|
write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final java.io.IOException exception
| Constructor Detail |
|---|
public BrokenOutputStream(java.io.IOException exception)
exception - the exception to be thrownpublic BrokenOutputStream()
IOException
| Method Detail |
|---|
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamb - ignored
java.io.IOException - always thrown
public void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException - always thrown
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOException - always thrown
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||