@Override
    public void close() throws IOException {
        if (_readAllBytes() || isAborted()) {
            super.close();
        } else {
            LOG.warn(
                    "Not all bytes were read from the S3ObjectInputStream, aborting HTTP connection. This is likely an error and " +
                    "may result in sub-optimal behavior. Request only the bytes you need via a ranged GET or drain the input " +
                    "stream after use.");
            if (httpRequest != null) {
                httpRequest.abort();
            }
            IOUtils.closeQuietly(in, null);
        }
    }
{@inheritDoc}

Delegates to {@link S3ObjectInputStream#abort()} if there is any data
remaining in the stream. Otherwise, it safely closes the stream.

@see {@link S3ObjectInputStream#abort()}
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/S3AbortableInputStream.java