@Override
    public int read(byte[] b, int off, int len) throws IOException {
        int result = super.read(b, off, len);
        if (result == -1) {
            validateMD5Digest();
        }
        return result;
    }
@see java.io.InputStream#read(byte[], int, int)
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/DigestValidationInputStream.java