if (requestInputStream != null) {
if (requestInputStream.markSupported()) {
try {
requestInputStream.reset();
} catch(IOException ex) {
throw new ResetException("Failed to reset the request input stream", ex);
}
}
}
}
// Reset the apache input stream
if (apacheInputStream != null) {
if (apacheInputStream.markSupported()) {
if (requestCount > 1) // retry
try {
apacheInputStream.reset();
} catch(IOException ex) {
throw new ResetException("Failed to reset the apache input stream", ex);
}
else { // first attempt => prepare for retry
final int readLimit = awsreq.getRequestClientOptions().getReadLimit();
apacheInputStream.mark(readLimit);
}