@Override
    public int read(byte[] b, int off, int len) throws IOException {
        triggerError();
        int read = super.read(b, off, len);
        position += read;
        triggerError();
        return read;
    }
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.
aws-java-sdk-core/src/main/java/com/amazonaws/util/UnreliableFilterInputStream.java