Package org.apache.axiom.testutils.io
Class ExceptionInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.commons.io.input.ProxyInputStream
-
- org.apache.axiom.testutils.io.ExceptionInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ExceptionInputStream extends org.apache.commons.io.input.ProxyInputStreamInputStreamwrapper that throws an exception after a configurable number of bytes have been read from the stream or when the end of the stream is reached.
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description ExceptionInputStream(InputStream in)ExceptionInputStream(InputStream in, int maxBytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IOExceptiongetException()intread()intread(byte[] b)intread(byte[] b, int off, int len)-
Methods inherited from class org.apache.commons.io.input.ProxyInputStream
afterRead, available, beforeRead, close, handleIOException, mark, markSupported, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
ExceptionInputStream
public ExceptionInputStream(InputStream in)
-
ExceptionInputStream
public ExceptionInputStream(InputStream in, int maxBytes)
-
-
Method Detail
-
read
public int read() throws IOException- Overrides:
readin classorg.apache.commons.io.input.ProxyInputStream- Throws:
IOException
-
read
public int read(byte[] b) throws IOException- Overrides:
readin classorg.apache.commons.io.input.ProxyInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classorg.apache.commons.io.input.ProxyInputStream- Throws:
IOException
-
getException
public IOException getException()
-
-