public Upload upload(final String bucketName, final String key, final InputStream input, ObjectMetadata objectMetadata)
        throws AmazonServiceException, AmazonClientException {
        return upload(new PutObjectRequest(bucketName, key, input, objectMetadata));
    }
<p>
Schedules a new transfer to upload data to Amazon S3. This method is
non-blocking and returns immediately (i.e. before the upload has
finished).
</p>
<p>
When uploading options from a stream, callers <b>must</b> supply the size of
options in the stream through the content length field in the
<code>ObjectMetadata</code> parameter.
If no content length is specified for the input
stream, then TransferManager will attempt to buffer all the stream
contents in memory and upload the options as a traditional, single part
upload. Because the entire stream contents must be buffered in memory,
this can be very expensive, and should be avoided whenever possible.
</p>
<p>
Use the returned <code>Upload</code> object to query the progress of the
transfer, add listeners for progress events, and wait for the upload to
complete.
</p>
<p>
If resources are available, the upload will begin immediately.
Otherwise, the upload is scheduled and started as soon as
resources become available.
</p>
<p>
If you are uploading <a href="http://aws.amazon.com/kms/">Amazon Web Services
KMS</a>-encrypted objects, you need to specify the correct region of the
bucket on your client and configure Amazon Web Services Signature Version 4 for added
security. For more information on how to do this, see
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#
specify-signature-version
</p>

@param bucketName
           The name of the bucket to upload the new object to.
@param key
           The key in the specified bucket by which to store the new
           object.
@param input
           The input stream containing the options to upload to Amazon S3.
@param objectMetadata
           Additional information about the object being uploaded,
           including the size of the options, content type, additional
           custom user metadata, etc.

@return A new <code>Upload</code> object to use to check
		   the state of the upload, listen for progress notifications,
		   and otherwise manage the upload.

@throws AmazonClientException
            If any errors are encountered in the client while making the
            request or handling the response.
@throws AmazonServiceException
            If any errors occurred in Amazon S3 while processing the
            request.
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java