public class BrokenInputStream
extends java.io.InputStream
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 and Description |
---|
BrokenInputStream()
Creates a new stream that always throws an
IOException |
BrokenInputStream(java.io.IOException exception)
Creates a new stream that always throws the given exception.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public BrokenInputStream(java.io.IOException exception)
exception
- the exception to be thrownpublic BrokenInputStream()
IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- always thrownpublic int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
- always thrownpublic long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
n
- ignoredjava.io.IOException
- always thrownpublic void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
- always thrownpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
- always thrownCopyright © 2010 - 2020 Adobe. All Rights Reserved