Package com.amazonaws.util
Class UnreliableFilterInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.amazonaws.util.UnreliableFilterInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
An internal class used solely for the purpose of testing via failure
injection.
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
int
int
int
int
int
boolean
void
mark
(int readlimit) int
read()
int
read
(byte[] b, int off, int len) void
reset()
toString()
withBytesReadBeforeException
(int bytesReadBeforeException) withMaxNumErrors
(int maxNumErrors) withResetIntervalBeforeException
(int resetIntervalBeforeException) Methods inherited from class java.io.FilterInputStream
available, close, markSupported, read, skip
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
UnreliableFilterInputStream
-
-
Method Details
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
mark
public void mark(int readlimit) - Overrides:
mark
in classFilterInputStream
-
reset
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
getCurrNumErrors
public int getCurrNumErrors() -
getMaxNumErrors
public int getMaxNumErrors() -
withMaxNumErrors
-
withBytesReadBeforeException
-
getBytesReadBeforeException
public int getBytesReadBeforeException() -
withResetIntervalBeforeException
public UnreliableFilterInputStream withResetIntervalBeforeException(int resetIntervalBeforeException) - Parameters:
resetIntervalBeforeException
- used to control whether an exception would be thrown based on the reset recurrence; not applicable if set to zero. For example, if resetIntervalBeforeException == n, the exception can only be thrown before the n_th reset (or after the n_th minus 1 reset), 2n_th reset (or after the 2n_th minus 1) reset), etc.
-
getResetIntervalBeforeException
public int getResetIntervalBeforeException() -
getMarked
public int getMarked() -
getPosition
public int getPosition() -
isFakeIOException
public boolean isFakeIOException() -
getResetCount
public int getResetCount() -
toString
-