code: public InputStream getInputStream(String bucketName, String key, Supplier<File> tempFileSupplier)
              throws AmazonServiceException, AmazonClientException, InterruptedException, IOException {
          File file = tempFileSupplier.get();
          try {
              Download download = transferManager.download(bucketName, key, file);
              download.waitForCompletion();
              return new ByteArrayInputStream(
                                              FileUtils.readFileToByteArray(file));
          } finally {
              file.delete();
          }
      }
docs: Method returns InputStream from S3Object. Multi-part download is used to
  get file. s3.tmp.dir property used to store temporary files. You can
  specify temporary file name by using tempFileSupplier object.
  
  @param bucketName
  @param key
  -
  @param tempFileSupplier
  - Supplier providing temporary filenames
  @return InputStream of
  @throws AmazonServiceException
  @throws AmazonClientException
  @throws InterruptedException
  @throws IOException