Package io.zeebe.test.util.io
Class RepeatedlyFailingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- io.zeebe.test.util.io.RepeatedlyFailingInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class RepeatedlyFailingInputStream extends InputStream
Throws anIOExceptionon everyfailureFrequencycall toread(). Otherwise reads the next byte from theunderlyingInputStream.
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_FAILURE_FREQUENCY
-
Constructor Summary
Constructors Constructor Description RepeatedlyFailingInputStream(InputStream underlyingInputStream)RepeatedlyFailingInputStream(InputStream underlyingInputStream, long failureFrequency)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intread()intread(byte[] b, int off, int len)-
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Field Detail
-
DEFAULT_FAILURE_FREQUENCY
public static final long DEFAULT_FAILURE_FREQUENCY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RepeatedlyFailingInputStream
public RepeatedlyFailingInputStream(InputStream underlyingInputStream)
-
RepeatedlyFailingInputStream
public RepeatedlyFailingInputStream(InputStream underlyingInputStream, long failureFrequency)
-
-
Method Detail
-
read
public int read() throws IOException- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
-