public class UnreliableFilterInputStream extends FilterInputStream
Constructor and Description |
---|
UnreliableFilterInputStream(InputStream in,
boolean isFakeIOException) |
Modifier and Type | Method and Description |
---|---|
int |
getBytesReadBeforeException() |
int |
getCurrNumErrors() |
int |
getMarked() |
int |
getMaxNumErrors() |
int |
getPosition() |
int |
getResetCount() |
int |
getResetIntervalBeforeException() |
boolean |
isFakeIOException() |
void |
mark(int readlimit) |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
String |
toString() |
UnreliableFilterInputStream |
withBytesReadBeforeException(int bytesReadBeforeException) |
UnreliableFilterInputStream |
withMaxNumErrors(int maxNumErrors) |
UnreliableFilterInputStream |
withResetIntervalBeforeException(int resetIntervalBeforeException) |
available, close, markSupported, read, skip
public UnreliableFilterInputStream(InputStream in, boolean isFakeIOException)
public int read() throws IOException
read
in class FilterInputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class FilterInputStream
IOException
public void mark(int readlimit)
mark
in class FilterInputStream
public void reset() throws IOException
reset
in class FilterInputStream
IOException
public int getCurrNumErrors()
public int getMaxNumErrors()
public UnreliableFilterInputStream withMaxNumErrors(int maxNumErrors)
public UnreliableFilterInputStream withBytesReadBeforeException(int bytesReadBeforeException)
public int getBytesReadBeforeException()
public UnreliableFilterInputStream withResetIntervalBeforeException(int resetIntervalBeforeException)
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.public int getResetIntervalBeforeException()
public int getMarked()
public int getPosition()
public boolean isFakeIOException()
public int getResetCount()