|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.apache.commons.io.input.BrokenInputStream
public class BrokenInputStream
Broken input stream. This stream always throws an IOException from
all the InputStream methods where the exception is declared.
This class is mostly useful for testing error handling in code that uses an input stream.
| Constructor Summary | |
|---|---|
BrokenInputStream()
Creates a new stream that always throws an IOException |
|
BrokenInputStream(IOException exception)
Creates a new stream that always throws the given exception. |
|
| Method Summary | |
|---|---|
int |
available()
Throws the configured exception. |
void |
close()
Throws the configured exception. |
int |
read()
Throws the configured exception. |
void |
reset()
Throws the configured exception. |
long |
skip(long n)
Throws the configured exception. |
| Methods inherited from class java.io.InputStream |
|---|
mark, markSupported, read, read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BrokenInputStream(IOException exception)
exception - the exception to be thrownpublic BrokenInputStream()
IOException
| Method Detail |
|---|
public int read()
throws IOException
read in class InputStreamIOException - always thrown
public int available()
throws IOException
available in class InputStreamIOException - always thrown
public long skip(long n)
throws IOException
skip in class InputStreamn - ignored
IOException - always thrown
public void reset()
throws IOException
reset in class InputStreamIOException - always thrown
public void close()
throws IOException
close in interface Closeableclose in class InputStreamIOException - always thrown
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||